Hi, I’m working on a complex script, so I’ve separate it in different file: init.py (user interface and custom properties)
setting.py (property settings on user preferences)
operators.py
In the setting.py I create the class for the panel in Addons User Preference.
So it store a property like this:
col = BoolProperty(name="Colors",description="Randomize",default=True)
This looks a bit like something I remember reading recently but I can’t recall where (sorry)
Anyway it said basically for the properties to register properly you needed to use
bl_idname = name
in your prefferences class
this would then be mapped to the file name and it would work.
If you have split off the settings into a different file this could be where it’s getting lost.
Sorry for my bad Italian
Also sorry for my limited knowledge I just thought this might help.
The preferences properties work, the bl_idname is “color_randomize”.
The problem is that the preferences can’t be saved in the working.blend file, but only in the user preferences panel, how default data.
If you reload the working.blend file your properties are keep from the user preference.
So, I have create a second properties type, store in the bpy.types.Scene, this prop are saved in the active scene.
I want that the prop in scene, has as default value, the prop in the user preferences.
Who use the script, set at first the props in the preference, as default for every first load of the script.
And the props in the scene are store for each working.blend file that the user want to create.
It is the inverse…
addon_prefs.col show me the value (True) in the panel class, but above, where I create the Scene.col prop it don’t find the preferences value.
You can’t use a property’s value as default for another, it is not supported (context is restricted at registration time). You might be able to set the value on a user action, such as a button click however.