Coin rendering help needed

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
realthunder
Posts: 1234
Joined: Tue Jan 03, 2017 10:55 am

Coin rendering help needed

Postby realthunder » Tue May 23, 2017 9:47 am

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 (latest version 0.10.2) along 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
Posts: 1234
Joined: Tue Jan 03, 2017 10:55 am

Re: Coin rendering help needed

Postby realthunder » Thu May 25, 2017 7:16 pm

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 (latest version 0.10.2) along 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
Posts: 1500
Joined: Thu Feb 18, 2010 1:07 am

Re: Coin rendering help needed

Postby tanderson69 » Thu May 25, 2017 8:41 pm

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
Posts: 2655
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Coin rendering help needed

Postby PrzemoF » Fri May 26, 2017 7:59 am

@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
Posts: 1234
Joined: Tue Jan 03, 2017 10:55 am

Re: Coin rendering help needed

Postby realthunder » Fri May 26, 2017 8:08 am

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 (latest version 0.10.2) along 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