BIM: fix material handling of component

This commit is contained in:
Roy-043
2025-09-13 18:24:58 +02:00
committed by Yorik van Havre
parent 02bc3f60b1
commit a44ac1aa58

View File

@@ -1374,6 +1374,9 @@ class ViewProviderComponent:
c = tuple([float(f) for f in obj.Material.Material["DiffuseColor"].strip("()").strip("[]").split(",")])
if obj.ViewObject.ShapeColor != c:
obj.ViewObject.ShapeColor = c
# Overwrite DiffuseColor (required if it does not match number of faces):
if obj.ViewObject.DiffuseColor != [c]:
obj.ViewObject.DiffuseColor = [c]
if "Transparency" in obj.Material.Material:
t = int(obj.Material.Material["Transparency"])
if obj.ViewObject.Transparency != t: