Fix #3465. Move representation utilities into new tab system.

This commit is contained in:
Dion Moult
2023-07-30 23:18:58 +10:00
parent d330b2f0c6
commit e49c373011
3 changed files with 28 additions and 21 deletions
@@ -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"}
@@ -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)
@@ -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: