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)
The property is now accesseible from:
user_preferences = context.user_preferences
addon_prefs = user_preferences.addons['color_randomize'].preferences
and
addon_pref.col
So when I create the custom property like this in the init.py:
bpy.types.Scene.col = BoolProperty(name="Randomize Colors",
description="Randomize",
default=addon_pref.col)
I receive an error, because blender don’t find the addon_pref.col
I’ve the right code on the top of init.py to import the module and the classes:
if "bpy" in locals():
import imp
imp.reload(operators)
imp.reload(settings)
else:
from . import operators
from . import settings
Sorry for my bad English, I hope you have understand the problem