I'm looking at the selection gate code for the 3D operations and have come across something I don't understand.
To me it seems the following code have no effect.
Code: Select all
def surfaceselect():
gate = False
if MESHGate() or FACEGate():
gate = True
FreeCADGui.Selection.addSelectionGate(gate)
if not PathPreferences.suppressSelectionModeWarning():
FreeCAD.Console.PrintWarning("Surfacing Select Mode\n")
The first thing is that "MESHGate() or FACEGate()" is truthy, so "gate = True" will always be evaluated.
The second thing is that the documentation of "addSelectionGate" does not say that it can take a bool as argument.
Looking at the other *select functions I would expect the code to look something like this:
Code: Select all
def surfaceselect():
FreeCADGui.Selection.addSelectionGate(MESHGate())
FreeCADGui.Selection.addSelectionGate(FACEGate())
if not PathPreferences.suppressSelectionModeWarning():
FreeCAD.Console.PrintWarning("Surfacing Select Mode\n")
Thankful for any insight into how it works or should work.