Merge pull request #4244 from danreb25/BBLPatch_ArchComponentDiffuseColor

Arch: deal with missing DiffuseColor attributes on obj.CloneOf.ViewObject
This commit is contained in:
Yorik van Havre
2021-01-07 11:53:40 +01:00
committed by GitHub

View File

@@ -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