mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 04:59:52 +00:00
Fix #3843. Regression where IfcMaterialList UI didn't show list of materials.
This commit is contained in:
@@ -173,6 +173,8 @@ class ObjectMaterialData:
|
|||||||
items = cls.material.MaterialProfiles
|
items = cls.material.MaterialProfiles
|
||||||
elif cls.material.is_a("IfcMaterialConstituentSet"):
|
elif cls.material.is_a("IfcMaterialConstituentSet"):
|
||||||
items = cls.material.MaterialConstituents
|
items = cls.material.MaterialConstituents
|
||||||
|
elif cls.material.is_a("IfcMaterialList"):
|
||||||
|
items = cls.material.Materials
|
||||||
|
|
||||||
icon = "LAYER_ACTIVE"
|
icon = "LAYER_ACTIVE"
|
||||||
if "Layer" in cls.material.is_a():
|
if "Layer" in cls.material.is_a():
|
||||||
@@ -191,7 +193,9 @@ class ObjectMaterialData:
|
|||||||
data["name"] = "No Profile"
|
data["name"] = "No Profile"
|
||||||
if item.is_a("IfcMaterialLayer"):
|
if item.is_a("IfcMaterialLayer"):
|
||||||
data["name"] += f" ({item.LayerThickness})"
|
data["name"] += f" ({item.LayerThickness})"
|
||||||
if not item.is_a("IfcMaterialList"):
|
if item.is_a("IfcMaterial"):
|
||||||
|
data["material"] = item.Name or "Unnamed"
|
||||||
|
else:
|
||||||
data["material"] = item.Material.Name or "Unnamed"
|
data["material"] = item.Material.Name or "Unnamed"
|
||||||
results.append(data)
|
results.append(data)
|
||||||
return results
|
return results
|
||||||
|
|||||||
@@ -350,10 +350,8 @@ class AddListItem(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
ifcopenshell.api.run(
|
ifcopenshell.api.run(
|
||||||
"material.add_list_item",
|
"material.add_list_item",
|
||||||
self.file,
|
self.file,
|
||||||
**{
|
material_list=self.file.by_id(self.list_item_set),
|
||||||
"material_list": self.file.by_id(self.list_item_set),
|
material=self.file.by_id(int(obj.BIMObjectMaterialProperties.material)),
|
||||||
"material": self.file.by_id(int(obj.BIMObjectMaterialProperties.material)),
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -284,9 +284,11 @@ class BIM_PT_object_material(Panel):
|
|||||||
setattr(op, f"{ObjectMaterialData.data['set_item_name']}_index", index)
|
setattr(op, f"{ObjectMaterialData.data['set_item_name']}_index", index)
|
||||||
|
|
||||||
def draw_read_only_set_ui(self):
|
def draw_read_only_set_ui(self):
|
||||||
|
if ObjectMaterialData.data["material_class"] != "IfcMaterialList":
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="Name")
|
row.label(text="Name")
|
||||||
row.label(text=ObjectMaterialData.data["set"]["name"])
|
row.label(text=ObjectMaterialData.data["set"]["name"])
|
||||||
|
|
||||||
if ObjectMaterialData.data["set"]["description"]:
|
if ObjectMaterialData.data["set"]["description"]:
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="Description")
|
row.label(text="Description")
|
||||||
|
|||||||
Reference in New Issue
Block a user