mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
Material UI now prompts to add a profile if none exist in your library
This commit is contained in:
@@ -179,6 +179,8 @@ class ObjectMaterialData:
|
|||||||
|
|
||||||
for item in items or []:
|
for item in items or []:
|
||||||
data = {"id": item.id(), "name": item.Name or "Unnamed", "icon": icon}
|
data = {"id": item.id(), "name": item.Name or "Unnamed", "icon": icon}
|
||||||
|
if item.is_a("IfcMaterialProfile") and not item.Name:
|
||||||
|
data["name"] = item.Profile.ProfileName or "Unnamed"
|
||||||
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 not item.is_a("IfcMaterialList"):
|
||||||
|
|||||||
@@ -195,6 +195,11 @@ class BIM_PT_object_material(Panel):
|
|||||||
blenderbim.bim.helper.draw_attributes(self.props.material_set_attributes, self.layout)
|
blenderbim.bim.helper.draw_attributes(self.props.material_set_attributes, self.layout)
|
||||||
blenderbim.bim.helper.draw_attributes(self.props.material_set_usage_attributes, self.layout)
|
blenderbim.bim.helper.draw_attributes(self.props.material_set_usage_attributes, self.layout)
|
||||||
|
|
||||||
|
if ObjectMaterialData.data["set_item_name"] == "profile" and not self.mprops.profiles:
|
||||||
|
row = self.layout.row(align=True)
|
||||||
|
row.label(text="No Profiles Available")
|
||||||
|
row.operator("bim.add_profile_def", icon="ADD", text="")
|
||||||
|
else:
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
if ObjectMaterialData.data["set_item_name"] == "profile":
|
if ObjectMaterialData.data["set_item_name"] == "profile":
|
||||||
row.prop(self.mprops, "profiles", icon="ITALIC", text="")
|
row.prop(self.mprops, "profiles", icon="ITALIC", text="")
|
||||||
|
|||||||
Reference in New Issue
Block a user