From 7b4a1ddb875369817e142a90aa6594030dc42317 Mon Sep 17 00:00:00 2001 From: danrenb Date: Tue, 5 Jan 2021 12:27:05 +0100 Subject: [PATCH] deal with missing DiffuseColor attributes on obj.CloneOf.ViewObject --- src/Mod/Arch/ArchComponent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 5a9329fa2b..2fec7cb11f 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -1205,7 +1205,7 @@ class ViewProviderComponent: if hasattr(obj,"Material"): if obj.Material: mat = obj.Material - if not mat: + if (not mat) and hasattr(obj.CloneOf.ViewObject,"DiffuseColor"): if obj.ViewObject.DiffuseColor != obj.CloneOf.ViewObject.DiffuseColor: if len(obj.CloneOf.ViewObject.DiffuseColor) > 1: obj.ViewObject.DiffuseColor = obj.CloneOf.ViewObject.DiffuseColor @@ -1259,7 +1259,7 @@ class ViewProviderComponent: # this would now hide all previous windows... Not the desired behaviour anymore. if prop == "DiffuseColor": if hasattr(vobj.Object,"CloneOf"): - if vobj.Object.CloneOf: + if vobj.Object.CloneOf and hasattr(vobj.Object.CloneOf,"DiffuseColor"): if len(vobj.Object.CloneOf.ViewObject.DiffuseColor) > 1: if vobj.DiffuseColor != vobj.Object.CloneOf.ViewObject.DiffuseColor: vobj.DiffuseColor = vobj.Object.CloneOf.ViewObject.DiffuseColor