Blender uses the same search filter value for all enum search menus.
So if we select an item in some enum search menu, we have to delete the filter to view available options in other search menus.
To fix it the filter should be cleared if its value is not a substring of the current enum item's name.
Details
Details
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
Comment Actions
You can test the patch using this script:
import bpy
class TestSearchA(bpy.types.Operator):
bl_idname = "test.search_a"
bl_label = "Search A"
bl_property = "search_a"
search_a = bpy.props.EnumProperty(items=(
('ITEM_A1', "Item A1", ""),
('ITEM_A2', "Item A2", ""),
('ITEM_A3', "Item A3", ""),
))
def execute(self, context):
return {'CANCELLED'}
def invoke(self, context, event):
context.window_manager.invoke_search_popup(self)
return {'FINISHED'}
class TestSearchB(bpy.types.Operator):
bl_idname = "test.search_b"
bl_label = "Search B"
bl_property = "search_b"
def get_items(cls, context):
return (
('ITEM_B1', "Item B1", ""),
('ITEM_B2', "Item B2", ""),
('ITEM_B3', "Item B3", ""),
)
wrong_prop = bpy.props.StringProperty()
search_b = bpy.props.EnumProperty(items=get_items)
def execute(self, context):
return {'CANCELLED'}
def invoke(self, context, event):
context.window_manager.invoke_search_popup(self)
return {'FINISHED'}
class TestPanel(bpy.types.Panel):
bl_label = "Test Panel"
bl_space_type = 'TEXT_EDITOR'
bl_region_type = 'UI'
def draw(self, context):
layout = self.layout
layout.operator("test.search_a")
layout.operator("test.search_b")
bpy.utils.register_class(TestSearchA)
bpy.utils.register_class(TestSearchB)
bpy.utils.register_class(TestPanel)