Added full unit test to make sure tool chain works correctly.

This commit is contained in:
Markus Lampert
2017-08-22 11:12:02 -07:00
parent fbc8db743f
commit 504e4b7109
5 changed files with 100 additions and 26 deletions

View File

@@ -376,13 +376,14 @@ def findToolController(obj, name=None):
PathLog.track('name: {}'.format(name))
c = None
# First check if a user has selected a tool controller in the tree. Return the first one and remove all from selection
for sel in FreeCADGui.Selection.getSelectionEx():
if hasattr(sel.Object, 'Proxy'):
if isinstance(sel.Object.Proxy, PathScripts.PathToolController.ToolController):
if c is None:
c = sel.Object
FreeCADGui.Selection.removeSelection(sel.Object)
if FreeCAD.GuiUp:
# First check if a user has selected a tool controller in the tree. Return the first one and remove all from selection
for sel in FreeCADGui.Selection.getSelectionEx():
if hasattr(sel.Object, 'Proxy'):
if isinstance(sel.Object.Proxy, PathScripts.PathToolController.ToolController):
if c is None:
c = sel.Object
FreeCADGui.Selection.removeSelection(sel.Object)
if c is not None:
return c