Always show edit UI even if you don't have a BIM Tool activated.

This commit is contained in:
Dion Moult
2025-10-22 11:07:18 +11:00
parent 8fcc622b8a
commit 87bfd182d7
2 changed files with 14 additions and 7 deletions
@@ -265,6 +265,7 @@ def register():
type=prop.BIMExternalParametricGeometryProperties
)
bpy.types.VIEW3D_HT_tool_header.prepend(workspace.workspace_settings)
bpy.types.VIEW3D_MT_add.prepend(ui.add_menu)
bpy.app.handlers.load_post.append(handler.load_post)
@@ -98,18 +98,24 @@ class BimTool(WorkSpaceTool):
def draw_settings(
cls, context: bpy.types.Context, layout: bpy.types.UILayout, ws_tool: bpy.types.WorkSpaceTool
) -> None:
props = tool.Geometry.get_geometry_props()
ifc_element_type = None if cls.ifc_element_type == "all" else cls.ifc_element_type
if props.mode == "ITEM":
EditItemUI.draw(context, layout)
elif (
active_ifc_object := (context.active_object and tool.Ifc.get_entity(context.active_object))
) and context.selected_objects:
EditObjectUI.draw(context, layout, ifc_element_type=ifc_element_type)
if tool.Geometry.get_geometry_props().mode == "ITEM":
pass
elif context.active_object and tool.Ifc.get_entity(context.active_object) and context.selected_objects:
pass
else:
CreateObjectUI.draw(context, layout, ifc_element_type=ifc_element_type)
def workspace_settings(self, context):
if not tool.Ifc.get():
return
if tool.Geometry.get_geometry_props().mode == "ITEM":
EditItemUI.draw(context, self.layout)
elif context.active_object and tool.Ifc.get_entity(context.active_object) and context.selected_objects:
EditObjectUI.draw(context, self.layout)
class WallTool(BimTool):
bl_space_type = "VIEW_3D"
bl_context_mode = "OBJECT"