mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Always show edit UI even if you don't have a BIM Tool activated.
This commit is contained in:
@@ -265,6 +265,7 @@ def register():
|
|||||||
type=prop.BIMExternalParametricGeometryProperties
|
type=prop.BIMExternalParametricGeometryProperties
|
||||||
)
|
)
|
||||||
|
|
||||||
|
bpy.types.VIEW3D_HT_tool_header.prepend(workspace.workspace_settings)
|
||||||
bpy.types.VIEW3D_MT_add.prepend(ui.add_menu)
|
bpy.types.VIEW3D_MT_add.prepend(ui.add_menu)
|
||||||
bpy.app.handlers.load_post.append(handler.load_post)
|
bpy.app.handlers.load_post.append(handler.load_post)
|
||||||
|
|
||||||
|
|||||||
@@ -98,18 +98,24 @@ class BimTool(WorkSpaceTool):
|
|||||||
def draw_settings(
|
def draw_settings(
|
||||||
cls, context: bpy.types.Context, layout: bpy.types.UILayout, ws_tool: bpy.types.WorkSpaceTool
|
cls, context: bpy.types.Context, layout: bpy.types.UILayout, ws_tool: bpy.types.WorkSpaceTool
|
||||||
) -> None:
|
) -> None:
|
||||||
props = tool.Geometry.get_geometry_props()
|
|
||||||
ifc_element_type = None if cls.ifc_element_type == "all" else cls.ifc_element_type
|
ifc_element_type = None if cls.ifc_element_type == "all" else cls.ifc_element_type
|
||||||
if props.mode == "ITEM":
|
if tool.Geometry.get_geometry_props().mode == "ITEM":
|
||||||
EditItemUI.draw(context, layout)
|
pass
|
||||||
elif (
|
elif context.active_object and tool.Ifc.get_entity(context.active_object) and context.selected_objects:
|
||||||
active_ifc_object := (context.active_object and tool.Ifc.get_entity(context.active_object))
|
pass
|
||||||
) and context.selected_objects:
|
|
||||||
EditObjectUI.draw(context, layout, ifc_element_type=ifc_element_type)
|
|
||||||
else:
|
else:
|
||||||
CreateObjectUI.draw(context, layout, ifc_element_type=ifc_element_type)
|
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):
|
class WallTool(BimTool):
|
||||||
bl_space_type = "VIEW_3D"
|
bl_space_type = "VIEW_3D"
|
||||||
bl_context_mode = "OBJECT"
|
bl_context_mode = "OBJECT"
|
||||||
|
|||||||
Reference in New Issue
Block a user