From afd6f422ee321d6e67fe410bf1ed597b32c419ba Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Wed, 11 Mar 2026 17:39:00 -0500 Subject: [PATCH] Fix AttributeError in prop_with_search caused by duplicate bl_idname The light module's EnumPropertySearch operator was using the same bl_idname ("bim.enum_property_search") as the main BIM_OT_enum_property_search in operator.py, but only defined prop_name and search_term properties, lacking should_click_ok and others. Whichever class registered last would overwrite the other, causing an AttributeError when helper.py tried to set op.should_click_ok on the stripped-down version. Renamed the light module operator to "radiance.enum_property_search" and updated the matching call in light/ui.py. Generated with the assistance of an AI coding tool. --- src/bonsai/bonsai/bim/module/light/operator.py | 2 +- src/bonsai/bonsai/bim/module/light/ui.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/light/operator.py b/src/bonsai/bonsai/bim/module/light/operator.py index cbb625b058..b13d603121 100644 --- a/src/bonsai/bonsai/bim/module/light/operator.py +++ b/src/bonsai/bonsai/bim/module/light/operator.py @@ -1037,7 +1037,7 @@ class RADIANCE_OT_open_spectraldb(bpy.types.Operator): class EnumPropertySearch(bpy.types.Operator): - bl_idname = "bim.enum_property_search" + bl_idname = "radiance.enum_property_search" bl_label = "Search Enum Property" bl_options = {"REGISTER", "UNDO"} diff --git a/src/bonsai/bonsai/bim/module/light/ui.py b/src/bonsai/bonsai/bim/module/light/ui.py index ab560155e0..c8ec0f1552 100644 --- a/src/bonsai/bonsai/bim/module/light/ui.py +++ b/src/bonsai/bonsai/bim/module/light/ui.py @@ -41,7 +41,7 @@ def prop_with_search(layout, data, prop_name, **kwargs): try: if len(get_enum_items(data, prop_name)) > 10: row.context_pointer_set(name="data", data=data) - op = row.operator("bim.enum_property_search", text="", icon="VIEWZOOM") + op = row.operator("radiance.enum_property_search", text="", icon="VIEWZOOM") op.prop_name = prop_name except TypeError: pass