IfcMaterialLayerSetUsage - Disable custom offset properties when the checkbox is unchecked

This commit is contained in:
Bruno Perdigão
2025-09-19 17:41:03 -03:00
parent c077727374
commit 730eafa74f
+7 -2
View File
@@ -231,7 +231,7 @@ class BIM_PT_object_material(Panel):
bonsai.bim.helper.draw_attributes(self.props.material_set_attributes, self.layout)
bonsai.bim.helper.draw_attributes(self.props.material_set_usage_attributes, self.layout)
self.custom_offset()
self.draw_custom_offset()
if ObjectMaterialData.data["set_item_name"] == "profile" and not self.mprops.profiles:
row = self.layout.row(align=True)
row.label(text="No Profiles Available")
@@ -391,7 +391,7 @@ class BIM_PT_object_material(Panel):
else:
row.label(text="Exterior")
def custom_offset(self):
def draw_custom_offset(self):
set_usage = ObjectMaterialData.data.get("set_usage", {})
layer_set_direction = set_usage.get("layer_set_direction")
if layer_set_direction:
@@ -401,10 +401,15 @@ class BIM_PT_object_material(Panel):
row = box.row(align=True)
if layer_set_direction == "AXIS2":
row.prop(self.props, "custom_wall_reference", text="Reference")
row.enabled = self.props.use_custom_offset
if layer_set_direction == "AXIS3":
row.prop(self.props, "custom_slab_reference", text="Reference")
row.enabled = self.props.use_custom_offset
row = box.row(align=True)
row.prop(self.props, "custom_offset", text="Custom Offset")
row.enabled = self.props.use_custom_offset
class BIM_UL_materials(UIList):