I need to store additional information in a .blend file, that occurs only once per file. So, attaching it to, for example, bpy.types.Scene
doesn't help.
Since bpy.data
is an instance of bpy.types.BlendData
, I tried attaching properties to bpy.types.BlendData
. This failed:
>>> bpy.types.BlendData.testProp = bpy.props.StringProperty()
>>> bpy.data.testProp
(<built-in function StringProperty>, {})
Here, bpy.data.testProp
is not a string, but some tuple, So it looks like registering properties on bpy.types.BlendData
is not supported, like it is for bpy.types.Object
:
>>> bpy.types.Object.testProp = bpy.props.StringProperty()
>>> bpy.data.objects['Camera'].testProp
''
Is it somehow possible to attach properties to bpy.types.BlendData
?
Are there other ways to register global data in a .blend file?