From 6eb2cd3152f542f19dcfb8e4087f72084ec072a4 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Fri, 10 Aug 2018 18:12:42 -0700 Subject: [PATCH] Set Operation's view object proxy to 0 to let the framework use the c++ implementation. --- src/Mod/Path/PathScripts/PathJob.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Mod/Path/PathScripts/PathJob.py b/src/Mod/Path/PathScripts/PathJob.py index 93bd08fb65..0a2c2c36bd 100644 --- a/src/Mod/Path/PathScripts/PathJob.py +++ b/src/Mod/Path/PathScripts/PathJob.py @@ -117,6 +117,8 @@ class ObjectJob: obj.GeometryTolerance = PathPreferences.defaultGeometryTolerance() ops = FreeCAD.ActiveDocument.addObject("Path::FeatureCompoundPython", "Operations") + if ops.ViewObject: + ops.ViewObject.Proxy = 0 obj.Operations = ops obj.setEditorMode('Operations', 2) # hide obj.setEditorMode('Placement', 2) @@ -189,8 +191,25 @@ class ObjectJob: if orig: setattr(obj, name, createResourceClone(obj, orig, name, icon)) + def fixupOperations(self, obj): + if obj.Operations.ViewObject: + try: + obj.Operations.ViewObject.DisplayMode + except: + name = obj.Operations.Name + label = obj.Operations.Label + ops = FreeCAD.ActiveDocument.addObject("Path::FeatureCompoundPython", "Operations") + ops.ViewObject.Proxy = 0 + ops.Group = obj.Operations.Group + obj.Operations.Group = [] + obj.Operations = ops + FreeCAD.ActiveDocument.removeObject(name) + ops.Label = label + + def onDocumentRestored(self, obj): self.fixupResourceClone(obj, 'Base', 'BaseGeometry') + self.fixupOperations(obj) self.setupSetupSheet(obj) def onChanged(self, obj, prop):