From 641f615bf501a63a2c152ab74a24108ad295ca02 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 6 Oct 2019 22:13:07 -0700 Subject: [PATCH 1/2] Restrict loading of ocl and PathSurface to enabling experimental features. --- src/Mod/Path/InitGui.py | 1 + src/Mod/Path/PathScripts/PathGuiInit.py | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Mod/Path/InitGui.py b/src/Mod/Path/InitGui.py index d774972f9b93..b6a8b613c842 100644 --- a/src/Mod/Path/InitGui.py +++ b/src/Mod/Path/InitGui.py @@ -98,6 +98,7 @@ def Initialize(self): try: import ocl # pylint: disable=unused-variable + from PathScripts import PathSurfaceGui threedopcmdlist.append("Path_Surface") threedcmdgroup = ['Path_3dTools'] FreeCADGui.addCommand('Path_3dTools', PathCommandGroup(threedopcmdlist, QtCore.QT_TRANSLATE_NOOP("Path",'3D Operations'))) diff --git a/src/Mod/Path/PathScripts/PathGuiInit.py b/src/Mod/Path/PathScripts/PathGuiInit.py index 7ca84d5a1a7f..da66403398bc 100644 --- a/src/Mod/Path/PathScripts/PathGuiInit.py +++ b/src/Mod/Path/PathScripts/PathGuiInit.py @@ -68,12 +68,6 @@ def Startup(): from PathScripts import PathSimpleCopy from PathScripts import PathSimulatorGui from PathScripts import PathStop - try: - import ocl - from PathScripts import PathSurfaceGui - except ImportError: - import FreeCAD - FreeCAD.Console.PrintError("OpenCamLib is not working!\n") from PathScripts import PathToolController from PathScripts import PathToolControllerGui from PathScripts import PathToolLibraryManager From 4dc50edf55637f9fdc9d1cf3af3b24f1e4035db8 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 14 Oct 2019 11:11:16 -0700 Subject: [PATCH 2/2] Fixed holding tags restore --- src/Mod/Path/PathScripts/PathDressupHoldingTags.py | 14 +++++++++----- src/Mod/Path/PathScripts/PathDressupTagGui.py | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py index d512ad56382b..667d054eda60 100644 --- a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py +++ b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py @@ -739,21 +739,25 @@ def __init__(self, obj, base): obj.addProperty("App::PropertyIntegerList", "Disabled", "Tag", QtCore.QT_TRANSLATE_NOOP("Path_DressupTag", "IDs of disabled holding tags")) obj.addProperty("App::PropertyInteger", "SegmentationFactor", "Tag", QtCore.QT_TRANSLATE_NOOP("Path_DressupTag", "Factor determining the # of segments used to approximate rounded tags.")) + self.__setstate__(obj) + obj.Proxy = self obj.Base = base - self.obj = obj + def __getstate__(self): + return None + + def __setstate__(self, state): + self.obj = state self.solids = [] self.tags = [] self.pathData = None self.toolRadius = None self.mappers = [] - - def __getstate__(self): return None - def __setstate__(self, state): - return None + def onDocumentRestored(self, obj): + self.obj = obj def supportsTagGeneration(self, obj): if not self.pathData: diff --git a/src/Mod/Path/PathScripts/PathDressupTagGui.py b/src/Mod/Path/PathScripts/PathDressupTagGui.py index 43d9b4e9971d..a14cb6c261f7 100644 --- a/src/Mod/Path/PathScripts/PathDressupTagGui.py +++ b/src/Mod/Path/PathScripts/PathDressupTagGui.py @@ -229,7 +229,7 @@ def addNewTagAt(self, point, obj): self.Positions.append(FreeCAD.Vector(point.x, point.y, 0)) self.updateTagsView() else: - print("ignore new tag at %s (obj=%s, on-path=%d" % (point, obj, 0)) + PathLog.notice("ignore new tag at %s (obj=%s, on-path=%d" % (point, obj, 0)) def addNewTag(self): self.tags = self.getTags(True)