I'm trying to initialize a PropertyGroup with pointers to objects inside another PropertyGroup. I'm getting an error: bpy_struct "ListItem" registration error: object_group could not register. Am I doing something wrong? In principle I'm trying to hold pointers to objects in a list, with each list with a label. Answer from here doesn't seem to be working:Register Object inside of Another Object

class ObjectPointer(PropertyGroup):

    obj: bpy.props.PointerProperty(type = bpy.types.Object)

class ListItem(PropertyGroup):

    name: StringProperty(
        name = "Name"

    object_group: CollectionProperty(type = objectPointer)

Inside register():

bpy.types.Scene.my_list = CollectionProperty(type = ListItem)
  • 1
    $\begingroup$ Is your question about how to display a custom name per object? What's the goal? Related: blender.stackexchange.com/questions/30444/… also see: blender.stackexchange.com/a/159353/31447 $\endgroup$ – brockmann Jan 4 at 21:28
  • $\begingroup$ Make sure you register ObjectPointer first, then ListItem and finally assign it to my_list in the register function. Also make sure (type = objectPointer) is written like (type = ObjectPointer) (ObjectPointer with capital O, but might be just a typo in your question). $\endgroup$ – Sighthound Jan 6 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.