See #7166. Only show total thickness for layer sets.

This commit is contained in:
Dion Moult
2025-10-05 20:13:40 +11:00
parent 2ede8a2206
commit bd5d4cecbf
@@ -323,12 +323,15 @@ class ObjectMaterialData:
@classmethod @classmethod
def total_thickness(cls): def total_thickness(cls):
if cls.material: if not cls.material:
return
layers = [] layers = []
if cls.material.is_a("IfcMaterialLayerSetUsage"): if cls.material.is_a("IfcMaterialLayerSetUsage"):
layers = cls.material.ForLayerSet.MaterialLayers layers = cls.material.ForLayerSet.MaterialLayers
elif cls.material.is_a("IfcMaterialLayerSet"): elif cls.material.is_a("IfcMaterialLayerSet"):
layers = cls.material.MaterialLayers layers = cls.material.MaterialLayers
if not layers:
return
thickness = sum([l.LayerThickness for l in layers or []]) thickness = sum([l.LayerThickness for l in layers or []])
prefs = tool.Blender.get_addon_preferences() prefs = tool.Blender.get_addon_preferences()
assert bpy.context.scene assert bpy.context.scene