From 8aec8cbebd2cf85b748a320147b5f69db75f2d4c Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 14 Oct 2019 11:11:16 -0700 Subject: [PATCH] Fixed holding tags restore --- .../Path/PathScripts/PathDressupHoldingTags.py | 18 +++++++++++------- src/Mod/Path/PathScripts/PathDressupTagGui.py | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py index d512ad5638..667d054eda 100644 --- a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py +++ b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py @@ -739,22 +739,26 @@ class ObjectTagDressup: 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 - self.solids = [] - self.tags = [] - self.pathData = None - self.toolRadius = None - self.mappers = [] - def __getstate__(self): return None def __setstate__(self, state): + self.obj = state + self.solids = [] + self.tags = [] + self.pathData = None + self.toolRadius = None + self.mappers = [] return None + def onDocumentRestored(self, obj): + self.obj = obj + def supportsTagGeneration(self, obj): if not self.pathData: self.setup(obj) diff --git a/src/Mod/Path/PathScripts/PathDressupTagGui.py b/src/Mod/Path/PathScripts/PathDressupTagGui.py index 43d9b4e997..a14cb6c261 100644 --- a/src/Mod/Path/PathScripts/PathDressupTagGui.py +++ b/src/Mod/Path/PathScripts/PathDressupTagGui.py @@ -229,7 +229,7 @@ class PathDressupTagTaskPanel: 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)