From fd48f70ef17e351393fe938c59bfec65d50ddd65 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 8 Jul 2024 14:40:44 +0500 Subject: [PATCH] poll message that non-IfcSurfaceStyles are not currently supported https://i.imgur.com/EBbMUaI.png --- src/blenderbim/blenderbim/bim/module/style/operator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/style/operator.py b/src/blenderbim/blenderbim/bim/module/style/operator.py index ce1a58e5a0..e94e925404 100644 --- a/src/blenderbim/blenderbim/bim/module/style/operator.py +++ b/src/blenderbim/blenderbim/bim/module/style/operator.py @@ -540,6 +540,14 @@ class EnableAddingPresentationStyle(bpy.types.Operator, tool.Ifc.Operator): bl_label = "Enable Add Presentation Style" bl_options = {"REGISTER", "UNDO"} + @classmethod + def poll(cls, context): + style_type = bpy.context.scene.BIMStylesProperties.style_type + if style_type != "IfcSurfaceStyle": + cls.poll_message_set(f"Adding {style_type} is not currently supported.") + return False + return True + def _execute(self, context): props = bpy.context.scene.BIMStylesProperties props.is_adding = True