I have the following custom prop:
class Settings(bpy.types.PropertyGroup):
enabled = False
state = {
"some_data": None, # edit: this points to numpy array
"some_other_data": None
}
string_prop = StringProperty(
name='Heyyy')
Assigned to:
bpy.types.Object.my_settings = PointerProperty(type=Settings)
There are two issues I am having.
1) I cannot change the value of enabled
, like so:
class Init(bpy.types.Operator):
bl_idname = "object.init"
bl_label = "Init"
def execute(self, context):
context.object.my_settings.enabled = True
return {'FINISHED'}
2) All of the objects share and control values of state
There are no issues with blender props like the string_prop
above.
I assume this is just how Blender handles custom PropertyGroups. Is there a way to make this work? I need to have information stored per object. The only other solution I can think of so far is to store an array of custom props per scene and check which one is currently active based on the id of the selected object, but that is more complicated than I would like it to be.
property(getter, setter)
and a global (if you don't need to save) or could save to a string json style etc. $\endgroup$ – batFINGER Feb 26 '18 at 11:44