I'm very new to Blender scripting (not programming in general) and I can't seem to figure out how to save an array of some data type (probably want it to be another PropertyGroup) in a PropertyGroup that I put on bpy.types.Scene.ssData.

What I have tried so far is variations on this:

class SSData(bpy.types.PropertyGroup):
  totalCount: bpy.props.IntProperty(name="Subscene Count", description="Integer", default=0)
  list: ['ford']

but when I try to get the list property like this: bpy.context.scene.ssData.list I get an error AttributeError: 'SSData' object has no attribute 'list'. The other property is registered fine btw, I can get totalCount and set it to some other value as well.

I've searched in the Blender docs for some Array type that I can use like bpy.props.IntProperty but I can't find anything. I understand that the object I want there should inherit from bpy_structs but I don't know if I can make my own type based on that.

  • 3
    $\begingroup$ Does this help? blender.stackexchange.com/questions/16511/… $\endgroup$ – Ray Mairlot Aug 5 '19 at 16:05
  • $\begingroup$ @RayMairlot This definitely helps! Thank you very much. I tried something similar as well but I wasn't sure how the CollectionProperty thing works (given it has a function called add() that I didn't know about). $\endgroup$ – Dries Aug 6 '19 at 6:36

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.