From 06f14774f7d8ff3c3cd01cf16a42a0e332ef946c Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 16 Sep 2024 18:46:38 +0500 Subject: [PATCH] Avoid more unnecessary calls to docs api Noticed that prop_value could be other types besides str (e.g. int when using context menu on UIList item) and we can skip them to avoid redundant api calls. --- src/bonsai/bonsai/bim/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/ui.py b/src/bonsai/bonsai/bim/ui.py index 29529bd1d9..2fe2e99377 100644 --- a/src/bonsai/bonsai/bim/ui.py +++ b/src/bonsai/bonsai/bim/ui.py @@ -1076,7 +1076,7 @@ def draw_custom_context_menu(self, context): prop = context.button_pointer prop_name = context.button_prop.identifier prop_value = getattr(prop, prop_name, None) - if prop_value is None: + if not isinstance(prop_value, str): return version = tool.Ifc.get_schema() layout = self.layout