From e49c373011a9e343079e6672c653e4ee0396331f Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 30 Jul 2023 23:18:58 +1000 Subject: [PATCH] Fix #3465. Move representation utilities into new tab system. --- .../blenderbim/bim/module/debug/operator.py | 2 +- .../blenderbim/bim/module/debug/ui.py | 15 ++++++++- .../blenderbim/bim/module/geometry/ui.py | 32 ++++++++----------- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/debug/operator.py b/src/blenderbim/blenderbim/bim/module/debug/operator.py index b048816092..4317e9f6b4 100644 --- a/src/blenderbim/blenderbim/bim/module/debug/operator.py +++ b/src/blenderbim/blenderbim/bim/module/debug/operator.py @@ -121,7 +121,7 @@ class PurgeIfcLinks(bpy.types.Operator): class ConvertToBlender(bpy.types.Operator): - bl_idname = "bim.converttoblender" + bl_idname = "bim.convert_to_blender" bl_label = "Convert To Blender File" bl_description = "Removes all IFC data, and converts the file to a simple Blender file." bl_options = {"REGISTER", "UNDO"} diff --git a/src/blenderbim/blenderbim/bim/module/debug/ui.py b/src/blenderbim/blenderbim/bim/module/debug/ui.py index 1ca48978be..e8629f7854 100644 --- a/src/blenderbim/blenderbim/bim/module/debug/ui.py +++ b/src/blenderbim/blenderbim/bim/module/debug/ui.py @@ -58,7 +58,10 @@ class BIM_PT_debug(Panel): row.operator("bim.purge_ifc_links") row = layout.row() - row.operator("bim.converttoblender") + row.operator("bim.update_representation", text="Manually Save Representation") + + row = layout.row() + row.operator("bim.convert_to_blender") row = layout.row() row.operator("bim.create_all_shapes") @@ -80,6 +83,16 @@ class BIM_PT_debug(Panel): ).percentile = context.scene.BIMDebugProperties.percentile_of_polygons row.prop(props, "percentile_of_polygons", text="") + if context.active_object and context.active_object.data: + mprops = context.active_object.data.BIMMeshProperties + row = layout.row() + row.operator("bim.get_representation_ifc_parameters") + for index, ifc_parameter in enumerate(mprops.ifc_parameters): + row = layout.row(align=True) + row.prop(ifc_parameter, "name", text="") + row.prop(ifc_parameter, "value", text="") + row.operator("bim.update_parametric_representation", icon="FILE_REFRESH", text="").index = index + layout.label(text="Inspector:") row = layout.row(align=True) diff --git a/src/blenderbim/blenderbim/bim/module/geometry/ui.py b/src/blenderbim/blenderbim/bim/module/geometry/ui.py index 4fd697f940..7abe6872b1 100644 --- a/src/blenderbim/blenderbim/bim/module/geometry/ui.py +++ b/src/blenderbim/blenderbim/bim/module/geometry/ui.py @@ -125,11 +125,14 @@ class BIM_PT_connections(Panel): class BIM_PT_mesh(Panel): - bl_label = "Representation" + bl_label = "Representation Utilities" bl_idname = "BIM_PT_mesh" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "data" + bl_order = 2 + bl_options = {"DEFAULT_CLOSED"} + bl_parent_id = "BIM_PT_tab_representations" @classmethod def poll(cls, context): @@ -143,43 +146,34 @@ class BIM_PT_mesh(Panel): def draw(self, context): if not context.active_object.data: return + row = self.layout.row() + row.label(text="Advanced Users Only", icon="ERROR") + layout = self.layout - props = context.active_object.data.BIMMeshProperties row = layout.row() - row.operator("bim.copy_representation") + row.operator("bim.copy_representation", text="Copy Mesh From Active To Selected") row = layout.row() - row.operator("bim.update_representation") - - row = layout.row() - op = row.operator("bim.update_representation", text="Update Mesh As Tessellation") + op = row.operator("bim.update_representation", text="Convert To Tessellation") op.ifc_representation_class = "IfcTessellatedFaceSet" row = layout.row() - op = row.operator("bim.update_representation", text="Update Mesh As Rectangle Extrusion") + op = row.operator("bim.update_representation", text="Convert To Rectangle Extrusion") op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcRectangleProfileDef" row = layout.row() - op = row.operator("bim.update_representation", text="Update Mesh As Circle Extrusion") + op = row.operator("bim.update_representation", text="Convert To Circle Extrusion") op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcCircleProfileDef" row = layout.row() - op = row.operator("bim.update_representation", text="Update Mesh As Arbitrary Extrusion") + op = row.operator("bim.update_representation", text="Convert To Arbitrary Extrusion") op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcArbitraryClosedProfileDef" row = layout.row() - op = row.operator("bim.update_representation", text="Update Mesh As Arbitrary Extrusion With Voids") + op = row.operator("bim.update_representation", text="Convert To Arbitrary Extrusion With Voids") op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcArbitraryProfileDefWithVoids" - row = layout.row() - row.operator("bim.get_representation_ifc_parameters") - for index, ifc_parameter in enumerate(props.ifc_parameters): - row = layout.row(align=True) - row.prop(ifc_parameter, "name", text="") - row.prop(ifc_parameter, "value", text="") - row.operator("bim.update_parametric_representation", icon="FILE_REFRESH", text="").index = index - def BIM_PT_transform(self, context): if context.active_object and context.active_object.BIMObjectProperties.ifc_definition_id: