getColors BUG correction

correction proposed as explained in the forum topic https://forum.freecadweb.org/viewtopic.php?f=3&t=42191
This commit is contained in:
danreb25
2020-03-07 08:08:27 +01:00
committed by Yorik van Havre
parent e41915e638
commit 728fdfb06a

View File

@@ -645,8 +645,8 @@ class ViewProviderBuildingPart:
colors = []
for child in Draft.getGroupContents(obj):
if hasattr(child,'Shape'):
if len(child.ViewObject.DiffuseColor) == len(child.Shape.Faces):
if hasattr(child,'Shape') and (hasattr(child.ViewObject,"DiffuseColor") or hasattr(child.ViewObject,"ShapeColor")):
if hasattr(child.ViewObject,"DiffuseColor") and len(child.ViewObject.DiffuseColor) == len(child.Shape.Faces):
colors.extend(child.ViewObject.DiffuseColor)
else:
c = child.ViewObject.ShapeColor[:3]+(child.ViewObject.Transparency/100.0,)