From 62a0b64b2af6fbb49c0846a7cc548e16986fb280 Mon Sep 17 00:00:00 2001 From: Massimo Fabbro Date: Fri, 30 Jun 2023 06:30:26 +0200 Subject: [PATCH] Add regen button also under space tool --- .../blenderbim/bim/module/spatial/workspace.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/spatial/workspace.py b/src/blenderbim/blenderbim/bim/module/spatial/workspace.py index 52e5d271c8..b52232a61f 100644 --- a/src/blenderbim/blenderbim/bim/module/spatial/workspace.py +++ b/src/blenderbim/blenderbim/bim/module/spatial/workspace.py @@ -49,6 +49,7 @@ class SpatialTool(WorkSpaceTool): ("bim.spatial_hotkey", {"type": "A", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_A")]}), ("bim.spatial_hotkey", {"type": "B", "value": "PRESS", "alt": True}, {"properties": [("hotkey", "A_B")]}), ("bim.spatial_hotkey", {"type": "T", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_T")]}), + ("bim.spatial_hotkey", {"type": "G", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_G")]}), ) def draw_settings(context, layout, ws_tool): @@ -106,6 +107,14 @@ class SpatialToolUI: @classmethod def draw_selected_object_interface(cls, context): + active_obj = bpy.context.active_object + element = tool.Ifc.get_entity(active_obj) + if element and bpy.context.selected_objects and element.is_a("IfcSpace"): + row = cls.layout.row(align=True) + row.label(text="", icon="EVENT_SHIFT") + row.label(text="", icon="EVENT_G") + row.operator("bim.generate_space", text="Regen") + row = cls.layout.row(align=True) row.label(text="", icon="EVENT_SHIFT") row.label(text="", icon="EVENT_B") @@ -167,3 +176,6 @@ class Hotkey(bpy.types.Operator, Operator): def hotkey_S_T(self): bpy.ops.bim.toggle_space_visibility() + + def hotkey_S_G(self): + bpy.ops.bim.generate_space()