From 4843068458de15b77dc2a2b3f60c7e86dc28f60b Mon Sep 17 00:00:00 2001 From: Gorgious Date: Sat, 13 May 2023 20:32:44 +0200 Subject: [PATCH] "Select instances" button is now grayed out when the type doesn't have any instance --- src/blenderbim/blenderbim/bim/module/type/ui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/module/type/ui.py b/src/blenderbim/blenderbim/bim/module/type/ui.py index d2a1d8b2ae..35f8b0705f 100644 --- a/src/blenderbim/blenderbim/bim/module/type/ui.py +++ b/src/blenderbim/blenderbim/bim/module/type/ui.py @@ -59,7 +59,9 @@ class BIM_PT_type(Panel): oprops = context.active_object.BIMObjectProperties row = self.layout.row(align=True) row.label(text=f"{TypeData.data['total_instances']} Typed Objects") - row.operator("bim.select_type_objects", icon="RESTRICT_SELECT_OFF", text="") + select_type_objects_row = row.row(align=True) + select_type_objects_row.operator("bim.select_type_objects", icon="RESTRICT_SELECT_OFF", text="") + select_type_objects_row.enabled = int(TypeData.data["total_instances"]) > 0 def draw_product_ui(self, context): props = context.active_object.BIMTypeProperties