[Bf-committers] bpy.props: default values not saved

Сергей igelbox at gmail.com
Thu Feb 26 12:40:31 CET 2015


Hi,

I am a developer of addon that allows export blender models to 'X-Ray' game
engine.
My addon adds some custom properties to blender objects, meshes, bones, etc.
Some of these properties have default values (e.g.:
bpy.props.FloatProperty(name="Mass", default=1)) that are hardcoded in the
addon source code.
In new versions of addon I want to change the default values (e.g.:
bpy.props.FloatProperty(name="Mass", default=10)) and this leads to the
problem.

Problem scenario (using a simplified version of addon (see atachments)):
- user (uses old version of addon) creates an object
- then he goes to the object properties panel, and sees custom property
'Mass' value? which now defaults to 1kg
- user is satisfied with given value and it saves scene into file with name
'1kg-object.blend'
- after some amount of time user updates the plugin (new version uses 10 as
default value)
- after some more amount of time a user opens old file '1kg-object.blend',
but now from this file loaded object with 10kg! weight

Please tell me, is there any way to set property default value so that they
stored in .blend files?


More information about the Bf-committers mailing list