I was looking at this uilist, but I understand very little about how to replace materials with objects:
class MATERIAL_UL_Example(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
ob = data
slot = item
ma = slot.material
if self.layout_type in {'DEFAULT', 'COMPACT'}:
if ma:
layout.prop(ma, "name", text= "", emboss=False, icon_value=icon)
and in the panel class:
row.template_list("MATERIAL_UL_Example", "", ob, "material_slots", ob, "active_material_index",rows = 3)
I was wondering how to compile a list for some objects in the scene, I would need to compile objects based on a string property or by name, something like:
for o in scene.object:
if "My ob name" in o.name:
#put this object into the list