Is there a way to force Blender to generate a custom property ahead of time? It looks like custom properties added to objects are only generated when the user changes them from the default in the UI, which makes sense. But I've defined a setter handler in a custom property that spreads it to other objects (object_b.custom_prop = object_a.custom_prop
), and Blender halts execution of that setter when it encounters an object that hasn't had its property "generated" yet.
Edit: After discovering the console output messages, Blender throws the error "KeyError: 'bpy_struct[key]: key "PropertyName" not found'
when it encounters one of these objects before I manually prime it by manipulating the UI control for it. Still have not found an answer to this.
So I'm wondering if there is something I can do in this situation that will force the property to be generated? This is essentially the code in my setter that spreads it to other objects:
for obj in selected_list:
value = obj["custom_prop"]
value = math( value, active_object["custom_prop"] )
obj["custom_prop"] = value
It works fine as long as I "prime" the involved objects by manipulating their property first. But otherwise, it just stops when it encounters one that hasn't been primed.