Skip to content

Commit

Permalink
path: make dogbone dressup using new tool controller
Browse files Browse the repository at this point in the history
  • Loading branch information
gdoffe committed Mar 28, 2017
1 parent c5b7c98 commit 5af90ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Path/PathScripts/PathDressupDogbone.py
Expand Up @@ -347,6 +347,8 @@ def edges(self):
class ObjectDressup:

def __init__(self, obj):
# Tool Properties
obj.addProperty("App::PropertyLink", "ToolController", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "The tool controller that will be used to calculate the path"))
obj.addProperty("App::PropertyLink", "Base","Base", QtCore.QT_TRANSLATE_NOOP("PathDressup_Dogbone", "The base path to modify"))
obj.addProperty("App::PropertyEnumeration", "Side", "Dressup", QtCore.QT_TRANSLATE_NOOP("PathDressup_Dogbone", "The side of path to insert bones"))
obj.Side = [Side.Left, Side.Right]
Expand Down Expand Up @@ -780,11 +782,11 @@ def setup(self, obj):
obj.Side = 'On'

self.toolRadius = 5
toolLoad = PathUtils.getLastToolLoad(obj)
toolLoad = obj.ToolController
if toolLoad is None or toolLoad.ToolNumber == 0:
self.toolRadius = 5
else:
tool = PathUtils.getTool(obj, toolLoad.ToolNumber)
tool = toolLoad.Proxy.getTool(toolLoad) #PathUtils.getTool(obj, toolLoad.ToolNumber)
if not tool or tool.Diameter == 0:
self.toolRadius = 5
else:
Expand Down Expand Up @@ -1018,6 +1020,7 @@ def Activated(self):
FreeCADGui.doCommand('PathScripts.PathUtils.addToJob(obj)')
FreeCADGui.doCommand('obj.Base.ViewObject.Visibility = False')
FreeCADGui.doCommand('dbo.setup(obj)')
FreeCADGui.doCommand('obj.ToolController = PathScripts.PathUtils.findToolController(obj)')
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()

Expand Down

0 comments on commit 5af90ff

Please sign in to comment.