Path: more bug fixes

This commit is contained in:
sliptonic
2017-03-16 12:30:43 -05:00
committed by Yorik van Havre
parent b0745c96ef
commit d3fb9fbfe2
6 changed files with 123 additions and 119 deletions

View File

@@ -233,12 +233,16 @@ def findToolController(obj, name=None):
if no controller is found, returns None'''
PathLog.track('name: {}'.format(name))
#First check if a user has selected a tool controller in the tree.
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.PathLoadTool.LoadTool):
return sel.Object
if c is None:
c = sel.Object
FreeCADGui.Selection.removeSelection(sel.Object)
if c is not None:
return c
controllers = getToolControllers(obj)