Hi,
is it possible to temporarily disable preselection in the complete view.
I need this for a script I am working on where preseleciton is obstructive. There it prevents a directly view on highlighted inner faces/edges (see viewtopic.php?f=18&t=12381&p=151950#p151950). A manual workaround is to temporarily set the/all element/s to 'Selectable=False'. I could also set 'Selectable=False' for each object under the mouse cursor by script and restore its original state afterwards but I am sure there has to be a simpler and directer approach .
I found a similar post (viewtopic.php?f=22&t=17684&hilit=preselection) on disabling preselection for specific elements but want avoid this.
Thank you in advance,
HoWil
Temporarily disable preselection in complete view
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Temporarily disable preselection in complete view
Code: Select all
from pivy import coin
view=Gui.ActiveDocument.ActiveView.getViewer()
root=view.getSceneGraph()
root.highlightMode.getValue()
root.highlightMode.setValue(2) # off
Re: Temporarily disable preselection in complete view
Thank you wmayer,
is exactly what I was looking for!
BR,
HoWil
is exactly what I was looking for!
BR,
HoWil
Re: Temporarily disable preselection in complete view
Is it possible to do that with the selection filter ? If so what is the string to use ?wmayer wrote: ↑Sun Jan 08, 2017 11:57 amCode: Select all
from pivy import coin view=Gui.ActiveDocument.ActiveView.getViewer() root=view.getSceneGraph() root.highlightMode.getValue() root.highlightMode.setValue(2) # off
Code: Select all
filter = Gui.Selection.Filter('SELECT None')
Gui.Selection.addSelectionGate(filter)
Gui.Selection.removeSelectionGate()
Support me on Patreon: https://www.patreon.com/FreeCadDevDiary
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
Re: Temporarily disable preselection in complete view
You can do thisIs it possible to do that with the selection filter ? If so what is the string to use ?
Code: Select all
Gui.Selection.addSelectionGate('SELECT None')
Alternatively, how do you cancel the inactivation as per your code snippet?
Code: Select all
root.highlightMode.setValue(0)