Moved all post/pre processor into their own directory.
This commit is contained in:
@@ -27,8 +27,9 @@ from __future__ import print_function
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import os
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
import os
|
||||
|
||||
from PathScripts import PathJob
|
||||
from PathScripts import PathToolController
|
||||
@@ -248,8 +249,9 @@ class CommandPathPost:
|
||||
for obj in job.Group:
|
||||
PathLog.debug("obj: {}".format(obj.Name))
|
||||
if not isinstance(obj.Proxy, PathToolController.ToolController):
|
||||
if obj.ToolController.ToolNumber != currTool:
|
||||
postlist.append(obj.ToolController)
|
||||
tc = PathUtil.toolControllerForOp(obj)
|
||||
if tc.ToolNumber != currTool:
|
||||
postlist.append(tc)
|
||||
postlist.append(obj)
|
||||
|
||||
fail = True
|
||||
|
||||
@@ -51,6 +51,10 @@ class PathPreferences:
|
||||
def pathScriptsSourcePath(cls):
|
||||
return FreeCAD.getHomePath() + ("Mod/Path/PathScripts/")
|
||||
|
||||
@classmethod
|
||||
def pathScriptsPostSourcePath(cls):
|
||||
return cls.pathScriptsSourcePath() + ("/post/")
|
||||
|
||||
@classmethod
|
||||
def allAvailablePostProcessors(cls):
|
||||
allposts = []
|
||||
@@ -108,6 +112,7 @@ class PathPreferences:
|
||||
if p:
|
||||
paths.append(p)
|
||||
paths.append(cls.macroFilePath())
|
||||
paths.append(cls.pathScriptsPostSourcePath())
|
||||
paths.append(cls.pathScriptsSourcePath())
|
||||
return paths
|
||||
|
||||
|
||||
@@ -47,3 +47,10 @@ def isValidBaseObject(obj):
|
||||
if hasattr(obj, 'Sheets') or hasattr(obj, 'TagText'): # Arch.Panels and Arch.PanelCut
|
||||
return False
|
||||
return True
|
||||
|
||||
def toolControllerForOp(op):
|
||||
if hasattr(op, 'ToolController'):
|
||||
return op.ToolController
|
||||
if hasattr(op, 'Base'):
|
||||
return toolControllerForOp(op.Base)
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user