mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 10:23:41 +00:00
Fix #7782: Don't allow assigning styles if no styles available.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -102,7 +102,6 @@ class MaterialsData:
|
|||||||
if (style_name := s.Name) is not None
|
if (style_name := s.Name) is not None
|
||||||
]
|
]
|
||||||
results = natsorted(results, key=lambda i: i[1])
|
results = natsorted(results, key=lambda i: i[1])
|
||||||
results.insert(0, ("-", "No Surface Style", ""))
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -118,12 +118,17 @@ class BIM_PT_materials(Panel):
|
|||||||
row.operator("bim.edit_material", text="Save Material", icon="CHECKMARK").material = ifc_definition_id
|
row.operator("bim.edit_material", text="Save Material", icon="CHECKMARK").material = ifc_definition_id
|
||||||
row.operator("bim.disable_editing_material", text="", icon="CANCEL")
|
row.operator("bim.disable_editing_material", text="", icon="CANCEL")
|
||||||
elif self.props.editing_material_type == "STYLE":
|
elif self.props.editing_material_type == "STYLE":
|
||||||
row = self.layout.row(align=True)
|
if MaterialsData.data["styles"]:
|
||||||
row.prop(self.props, "contexts", text="")
|
row = self.layout.row(align=True)
|
||||||
prop_with_search(row, self.props, "styles", text="")
|
row.prop(self.props, "contexts", text="")
|
||||||
row = self.layout.row(align=True)
|
prop_with_search(row, self.props, "styles", text="")
|
||||||
row.operator("bim.edit_material_style", text="Assign Style", icon="CHECKMARK")
|
row = self.layout.row(align=True)
|
||||||
row.operator("bim.disable_editing_material", text="", icon="CANCEL")
|
row.operator("bim.edit_material_style", text="Assign Style", icon="CHECKMARK")
|
||||||
|
row.operator("bim.disable_editing_material", text="", icon="CANCEL")
|
||||||
|
else:
|
||||||
|
row = self.layout.row(align=True)
|
||||||
|
row.label(text="No Styles Found")
|
||||||
|
row.operator("bim.disable_editing_material", text="", icon="CANCEL")
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_object_material(Panel):
|
class BIM_PT_object_material(Panel):
|
||||||
|
|||||||
Reference in New Issue
Block a user