Can i store a array/list of Pointer Properties?!

import bpy

class customPropertiesGroup(bpy.types.PropertyGroup):
    objects = bpy.props.PointerProperty(type=bpy.types.Object)    
bpy.utils.register_class(customPropertiesGroup)

bpy.types.Object.customList = bpy.props.CollectionProperty(type=customPropertiesGroup)


ob = bpy.context.active_object.customList.add().name = 'ob_01'
ob = bpy.context.selected_objects[1].copy()

ob = bpy.context.active_object.customList.add().name = 'ob_02'
ob = bpy.context.selected_objects[0].copy()

can i access ob_01 and does ob_01 actually store a copy of selected object [1]?

It is not clear what the code is supposed to do.
Please provide more information.

Why do you copy objects, do you really need this?
Currently you only change the name of the items stored in the collection, but not the object itself.

Your objects property should have a singular name to be less confusing. There is only a single object pointer in this property group.

1 Like

i want to store object data like what modifiers the object currently has so that i can change the objects data at a later point to what it was before.
i can already do what i want but the way i do it is probably not the best what im currently doing is im making a copy of the selected object im giving it a index and a pointer variable so that i can loop trough all the object in the blend file and get the object that i want, i only really want the objects data like ob.data and ob.modifiers.
so what i want is a way to store arrays that contain the types of data that i mentioned above in blender that don’t get lost when i close blender and that i can access by object.variable_that_i_want[index or key].

Answered on StackExchange

I needed to store an python list with colours in the objects and this was my implementation.
in case it would be useful to anyone. This information is stored with the objects in the blender file, so it is persistent.

1 Like