I have a group of objects with several pieces that need to be separately positioned so I cannot join the meshes, but it creates a lot of clutter in the object search panels. I don't need to have them visible in the object selector panels at all, is there any way to hide them or at least group them in a way that they show up as a single object in search? I need to still see them in viewport and renders.
Took a while, I tried making a
CollectionProperty containing objects that met my criteria and doing a prop search on it but prop search was not accepting to display those objects. An enumeration based solution seemed like too much of a hack and an overkill. Instead I stumbled upon a solution which lead me to be able to filter objects based on arbitrary criteria, simply by "poll" on a
PointerProperty with a type
bpy.types.Object, I could have gone with a custom property but to keep it intuitive I used the selectable state of the object.
description="Select an object to Target",
and the filter for the poll was simply:
def selectable_filter(self, object):
return not object.hide_select
I didn't know poll could be used right in the PointerProperty that you stored the reference to the single object itself. It's counter-intuitive for me but I can understand the design decision now. This doesn't save the clutter from default Blender Panels but at least it gives me a way to filter out unnecessary things in my custom panel.