mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
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.
This commit is contained in:
@@ -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"}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user