From 066616707a75effacd72dbacf3e33bd7987015a5 Mon Sep 17 00:00:00 2001 From: Massimo Fabbro Date: Sun, 18 Feb 2024 16:12:34 +0100 Subject: [PATCH] Now generate space and generate spaces from walls are always visible in the UI so users understand better that are different procedures --- src/blenderbim/blenderbim/bim/module/model/space.py | 4 +++- .../blenderbim/bim/module/spatial/workspace.py | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/model/space.py b/src/blenderbim/blenderbim/bim/module/model/space.py index 067de63ed0..d0392b9884 100644 --- a/src/blenderbim/blenderbim/bim/module/model/space.py +++ b/src/blenderbim/blenderbim/bim/module/model/space.py @@ -35,7 +35,9 @@ class GenerateSpace(bpy.types.Operator, tool.Ifc.Operator): def poll(cls, context): collection = context.view_layer.active_layer_collection.collection collection_obj = collection.BIMCollectionProperties.obj - return tool.Ifc.get_entity(collection_obj) + active_obj = bpy.context.active_object + element = tool.Ifc.get_entity(active_obj) + return tool.Ifc.get_entity(collection_obj) and not element.is_a("IfcWall") def _execute(self, context): # This works as a 2.5 extruded polygon based on a cutting plane. Note diff --git a/src/blenderbim/blenderbim/bim/module/spatial/workspace.py b/src/blenderbim/blenderbim/bim/module/spatial/workspace.py index 4c74733ae6..031ac3df7a 100644 --- a/src/blenderbim/blenderbim/bim/module/spatial/workspace.py +++ b/src/blenderbim/blenderbim/bim/module/spatial/workspace.py @@ -98,10 +98,11 @@ class SpatialToolUI: row = cls.layout.row(align=True) row.label(text="", icon="EVENT_SHIFT") row.label(text="", icon="EVENT_A") - if context.selected_objects: - row.operator("bim.generate_spaces_from_walls") - else: - row.operator("bim.generate_space") + row.operator("bim.generate_spaces_from_walls") + row = cls.layout.row(align=True) + row.label(text="", icon="EVENT_SHIFT") + row.label(text="", icon="EVENT_A") + row.operator("bim.generate_space") row = cls.layout.row(align=True) row.label(text="", icon="EVENT_SHIFT") row.label(text="", icon="EVENT_T")