From 7eb1d6bd79b368a90696450fe60e8209031b5e46 Mon Sep 17 00:00:00 2001 From: mwganson Date: Sun, 3 Nov 2024 21:50:26 +0000 Subject: [PATCH] [Part Booleans] fix issue with copying visuals when doing Part workbench booleans using App::Part objects, see https://forum.freecad.org/viewtopic.php?t=91813&sid=eea2494d6d02882c3be7df74d7e2b689 --- src/Mod/Part/BOPTools/BOPFeatures.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Part/BOPTools/BOPFeatures.py b/src/Mod/Part/BOPTools/BOPFeatures.py index a069a01870..a1204b278e 100644 --- a/src/Mod/Part/BOPTools/BOPFeatures.py +++ b/src/Mod/Part/BOPTools/BOPFeatures.py @@ -103,10 +103,12 @@ class BOPFeatures: def copy_visual_attributes(self, target, source): if target.ViewObject: - target.ViewObject.ShapeAppearance = source.ViewObject.ShapeAppearance + if hasattr(target.ViewObject,"ShapeAppearance") and hasattr(source.ViewObject, "ShapeAppearance"): + target.ViewObject.ShapeAppearance = source.ViewObject.ShapeAppearance displayMode = source.ViewObject.DisplayMode src = source while displayMode == "Link": src = src.LinkedObject displayMode = src.ViewObject.DisplayMode - target.ViewObject.DisplayMode = displayMode + if displayMode in target.ViewObject.getEnumerationsOfProperty("DisplayMode"): + target.ViewObject.DisplayMode = displayMode