Visual clean up of bulk property editing UI

This commit is contained in:
Dion Moult
2022-01-07 14:57:50 +11:00
parent 84096529e1
commit eb04a7d579
5 changed files with 58 additions and 60 deletions
@@ -377,7 +377,7 @@ class CopyPropertyToSelection(bpy.types.Operator, Operator):
class BIM_OT_add_property_to_edit(bpy.types.Operator):
bl_label = "Add new row"
bl_label = "Add Edit Rule"
bl_idname = "bim.add_property_to_edit"
bl_options = {"REGISTER", "UNDO"}
option: bpy.props.StringProperty()
+48 -50
View File
@@ -379,18 +379,19 @@ class BIM_PT_work_schedule_psets(Panel):
class BIM_PT_bulk_property_editor(Panel):
bl_label = "IFC Bulk Property Editor"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_options = {"DEFAULT_CLOSED"}
def draw(self, context):
pass
class BIM_PT_rename_parameters(Panel):
bl_label = "Rename all building elements"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Bulk Rename Properties"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_parent_id = "BIM_PT_bulk_property_editor"
bl_options = {"DEFAULT_CLOSED"}
@@ -400,32 +401,31 @@ class BIM_PT_rename_parameters(Panel):
layout = self.layout
props = context.scene.RenameProperties
if props:
for index, prop in enumerate(props):
row = layout.row()
row.prop(prop, "pset_name", text="")
row.prop(prop, "existing_property_name", text="")
row.prop(prop, "new_property_name", text="")
op = row.operator("bim.remove_property_to_edit",icon="PANEL_CLOSE", text="")
op.index = index
op.option = "RenameProperties"
row = layout.row()
row.label()
op = row.operator("bim.add_property_to_edit", icon="ADD",text="")
op = row.operator("bim.add_property_to_edit", icon="ADD")
op.option = "RenameProperties"
if props:
row = layout.row()
clear = row.operator("bim.clear_list")
for index, prop in enumerate(props):
row = layout.row(align=True)
row.prop(prop, "pset_name", text="")
row.prop(prop, "existing_property_name", text="")
row.prop(prop, "new_property_name", text="")
op = row.operator("bim.remove_property_to_edit", icon="X", text="")
op.index = index
op.option = "RenameProperties"
if props:
row = layout.row(align=True)
row.operator("bim.rename_parameters", icon="CHECKMARK")
clear = row.operator("bim.clear_list", icon="CANCEL", text="")
clear.option = "RenameProperties"
row.operator("bim.rename_parameters")
class BIM_PT_add_edit_custom_properties(Panel):
bl_label = "Add/Edit Custom Properties and Values (to selected objects)"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Bulk Add / Edit Custom Properties"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_parent_id = "BIM_PT_bulk_property_editor"
bl_options = {"DEFAULT_CLOSED"}
@@ -435,33 +435,32 @@ class BIM_PT_add_edit_custom_properties(Panel):
layout = self.layout
props = context.scene.AddEditProperties
row = layout.row()
op = row.operator("bim.add_property_to_edit", icon="ADD")
op.option = "AddEditProperties"
if props:
for index, prop in enumerate(props):
row = layout.row()
row = layout.row(align=True)
row.prop(prop, "pset_name", text="")
row.prop(prop, "property_name", text="")
row.prop(prop, prop.get_value_name(), text="")
row.prop(prop, "primary_measure_type", text="")
op = row.operator("bim.remove_property_to_edit",icon="PANEL_CLOSE", text="")
op = row.operator("bim.remove_property_to_edit", icon="X", text="")
op.index = index
op.option = "AddEditProperties"
row = layout.row()
row.label()
op = row.operator("bim.add_property_to_edit", icon="ADD",text="")
op.option = "AddEditProperties"
if props:
row = layout.row()
clear = row.operator("bim.clear_list")
row = layout.row(align=True)
op = row.operator("bim.add_edit_custom_property", icon="CHECKMARK", text="Apply Changes")
clear = row.operator("bim.clear_list", icon="CANCEL", text="")
clear.option = "AddEditProperties"
op = row.operator("bim.add_edit_custom_property",icon="ADD", text="Apply Changes")
class BIM_PT_delete_psets(Panel):
bl_label = "Bulk remove psets from selected objects"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Bulk Remove Psets"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_parent_id = "BIM_PT_bulk_property_editor"
bl_options = {"DEFAULT_CLOSED"}
@@ -471,21 +470,20 @@ class BIM_PT_delete_psets(Panel):
layout = self.layout
props = context.scene.DeletePsets
if props:
for index, prop in enumerate(props):
row = layout.row()
row.prop(prop, "pset_name", text="Pset")
op = row.operator("bim.remove_property_to_edit",icon="PANEL_CLOSE", text="")
op.index = index
op.option = "DeletePsets"
row = layout.row(align=True)
row.label()
op = row.operator("bim.add_property_to_edit", icon="ADD",text="")
row = layout.row()
op = row.operator("bim.add_property_to_edit", icon="ADD")
op.option = "DeletePsets"
if props:
row = layout.row()
clear = row.operator("bim.clear_list")
for index, prop in enumerate(props):
row = layout.row(align=True)
row.prop(prop, "pset_name", text="")
op = row.operator("bim.remove_property_to_edit", icon="X", text="")
op.index = index
op.option = "DeletePsets"
if props:
row = layout.row(align=True)
op = row.operator("bim.bulk_remove_psets", icon="CHECKMARK", text="Apply Changes")
clear = row.operator("bim.clear_list", icon="CANCEL", text="")
clear.option = "DeletePsets"
op = row.operator("bim.bulk_remove_psets", text="Apply Changes")
@@ -46,6 +46,7 @@ def update_is_class_selected(self, context):
new = self.unselected_objects.add()
new.obj = obj
def update_is_level_selected(self, context):
if self.is_selected:
for obj in self.unselected_objects:
@@ -59,6 +60,7 @@ def update_is_level_selected(self, context):
new = self.unselected_objects.add()
new.obj = obj
class BIMFilterClasses(PropertyGroup):
name: StringProperty(name="Name")
is_selected: BoolProperty(name="Is Selected", default=True, update=update_is_class_selected)
@@ -320,9 +320,7 @@ class AssignStructuralAnalysisModel(bpy.types.Operator, Operator):
def _execute(self, context):
core.assign_structural_analysis_model(
tool.Ifc, tool.Structural,
product=self.product,
structural_analysis_model=self.structural_analysis_model
tool.Ifc, tool.Structural, product=self.product, structural_analysis_model=self.structural_analysis_model
)
@@ -335,9 +333,7 @@ class UnassignStructuralAnalysisModel(bpy.types.Operator, Operator):
def _execute(self, context):
core.unassign_structural_analysis_model(
tool.Ifc, tool.Structural,
product=self.product,
structural_analysis_model=self.structural_analysis_model
tool.Ifc, tool.Structural, product=self.product, structural_analysis_model=self.structural_analysis_model
)
@@ -36,11 +36,13 @@ class TypeData:
# These two are loaded discretely because relating_types depends on relating_type_classes
cls.data["relating_type_classes"] = cls.relating_type_classes()
cls.data["relating_types"] = cls.relating_types()
cls.data.update({
"is_product": cls.is_product(),
"total_instances": cls.total_instances(),
"type_name": cls.type_name(),
})
cls.data.update(
{
"is_product": cls.is_product(),
"total_instances": cls.total_instances(),
"type_name": cls.type_name(),
}
)
@classmethod
def relating_type_classes(cls):