I want to have a prop_search box that searches over two different bpy_prop_collection's.
My thinking on this is that I need to create a combined bpy_prop_collection using a parent class (say bpy.types.ID) and add all the values from the two lists to it.
But this doesn't seem possible for a few reasons, but mostly because it doesn't seem that you are allowed to change a bpy_prop_collection (or any prop type?) during a draw() call (where the prop_search is called).
So, is it possible to have a prop_search work with multiple collections some how?
Eg:
class SomeClass():
myProp: bpy.props.PointerProperty(type=bpy.types.ID, name="my", description="prop")
def draw(self, layout):
self.collection = bpy.props.CollectionProperty(type=bpy.types.ID, name="foo", description="bah")
for name, val in context.blend_data.objects.items():
self.collection[name] = val
for name, val in context.blend_data.collections.items():
self.collection[name] = val
layout.prop_search(self, "myProp", self, "collection")