Coin rendering help needed

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Coin rendering help needed

Post by realthunder »

I was working on my feature the other day, and exploring the FC coin selection code. I found that FC always requests for pick point list for each mouse click, to solve a priority issue (vertex over edge if the click point hits both). I needed some kind of pick point filtering also, so I thought why not enhance the FC selection API to bring out this pick list. I remembered having trouble selecting certain obscured subelement in the past, so this must be a useful feature. So I went ahead, and finished it. You can now request Selection API to give you the pick list on each click. The list is available through Python and SelectionView. I was happy until I found this annoying problem. When the element is either pre-selected or selected, it becomes opaque, so how can the user select the obscured subelement if he cannot see? Err... I am feeling stupid now. I digged into Part rendering code to try to solve this problem, but failed to came up with a solution. The delicate transparency rendering is apparently handled by Coin itself. Any coin expert here can come to the rescue? @wmayer?

Or, maybe we can have a way to disable preselecting temporarily. But which key to use? Ctrl, Alt, Shift all have special meaning during mouse movement. Any suggestions?
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Coin rendering help needed

Post by realthunder »

Nobody? Is this the right place to post this kind of asking for help topic? Anyway, I finally found a way, here you are.
Image
When pick list is enabled, any object with preselection or selection will automatically become transparent. Unfortunately, this feature is stuck with my Link branch with all kinds of other modification, it is likely to take a looong time to get merged.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Coin rendering help needed

Post by tanderson69 »

realthunder wrote:Unfortunately, this feature is stuck with my Link branch with all kinds of other modification, it is likely to take a looong time to get merged.
With git, nothing is ever stuck in a branch.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Coin rendering help needed

Post by PrzemoF »

@realthunder: Nice!

There are multiple ways of extracting your code from a git repository. git diff/git cherry-pick/git reset + git add -p/git rebase -i just to mention those I use frequently to split a "dirty" code into clean commits ready for the master branch.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Coin rendering help needed

Post by realthunder »

PrzemoF wrote:@realthunder: Nice!

There are multiple ways of extracting your code from a git repository. git diff/git cherry-pick/git reset + git add -p/git rebase -i just to mention those I use frequently to split a "dirty" code into clean commits ready for the master branch.
I can try, but it is going to be very difficult, because it has a lot of other dependencies in my early modifications. In fact, this picked list is a bonus feature of my requirement for partial rendering (i.e. selected faces, edges, etc) of an object with overridden materials. It comes from quite a few commits of not so subtle modification of FC core functions. I'd expect a lot of testing required for a proper merge.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
Post Reply