Replaced panel row with operator descriptor

This commit is contained in:
Benoit DAMAY
2024-03-04 17:10:19 +01:00
parent a6f6d0d676
commit 62a3b37397
2 changed files with 7 additions and 4 deletions
@@ -273,6 +273,7 @@ class RemoveProfile(bpy.types.Operator, tool.Ifc.Operator):
class AddLayer(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.add_layer"
bl_label = "Add Layer"
bl_description = "The List is Ordered From Origin Point"
bl_options = {"REGISTER", "UNDO"}
obj: bpy.props.StringProperty()
layer_set: bpy.props.IntProperty()
@@ -297,6 +298,7 @@ class AddLayer(bpy.types.Operator, tool.Ifc.Operator):
class ReorderMaterialSetItem(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.reorder_material_set_item"
bl_label = "Reorder Material Set Item"
bl_description = "The List is Ordered From Origin Point"
bl_options = {"REGISTER", "UNDO"}
obj: bpy.props.StringProperty()
old_index: bpy.props.IntProperty()
@@ -230,16 +230,17 @@ class BIM_PT_object_material(Panel):
row = self.layout.row(align=True)
row.label(text="No Profiles Available")
row.operator("bim.add_profile_def", icon="ADD", text="")
else:
else:
#indication to the user From where Layer set is stacked (#3515) Unactivated for now
# row = self.layout.row(align=True)
# row.alignment = "CENTER"
# row.label(text='From Origin Point')
row = self.layout.row(align=True)
if ObjectMaterialData.data["set_item_name"] == "profile":
prop_with_search(row, self.mprops, "profiles", icon="ITALIC", text="")
prop_with_search(row, self.props, "material", icon="MATERIAL", text="")
op = row.operator(f"bim.add_{ObjectMaterialData.data['set_item_name']}", icon="ADD", text="")
setattr(op, f"{ObjectMaterialData.data['set_item_name']}_set", ObjectMaterialData.data["set"]["id"])
row = self.layout.row(align=True)
row.alignment = "CENTER"
row.label(text='Layers listed from origin point')
total_items = len(ObjectMaterialData.data["set_items"])
for index, set_item in enumerate(ObjectMaterialData.data["set_items"]):