From 40cdf684914a4591f760cb4d008cba28896b3140 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Sun, 24 May 2020 07:48:55 +0100 Subject: [PATCH] only reset the Op visibility when the active state is toggled --- src/Mod/Path/PathCommands.py | 5 ++++- src/Mod/Path/PathScripts/PathOp.py | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/PathCommands.py b/src/Mod/Path/PathCommands.py index 3afbd053f7..bc20a3c333 100644 --- a/src/Mod/Path/PathCommands.py +++ b/src/Mod/Path/PathCommands.py @@ -150,7 +150,10 @@ class _ToggleOperation: def Activated(self): for sel in FreeCADGui.Selection.getSelectionEx(): - PathScripts.PathDressup.baseOp(sel.Object).Active = not(PathScripts.PathDressup.baseOp(sel.Object).Active) + op = PathScripts.PathDressup.baseOp(sel.Object) + op.Active = not op.Active + op.ViewObject.Visibility = op.Active + FreeCAD.ActiveDocument.recompute() diff --git a/src/Mod/Path/PathScripts/PathOp.py b/src/Mod/Path/PathScripts/PathOp.py index f810ba0139..494dede4f9 100644 --- a/src/Mod/Path/PathScripts/PathOp.py +++ b/src/Mod/Path/PathScripts/PathOp.py @@ -472,9 +472,6 @@ class ObjectOp(object): ''' PathLog.track() - if obj.ViewObject: - obj.ViewObject.Visibility = obj.Active - if not obj.Active: path = Path.Path("(inactive operation)") obj.Path = path