[Bf-python] Addon's can no longer access context on activation.

Domino Marama domino at dominodesigns.info
Thu Dec 20 14:09:39 CET 2012


On 12/20/2012 12:41 PM, Matt Ebb wrote:
> Being able to store properties in user preferences for example, would
> be a great thing to have in this case (and others). I too have to
> store global settings in the scene, because unfortunately there's
> nowhere else to put it...
>
This would be very useful. As far as I know, they only sane way to
handle custom prefs at the moment is with something like:

def register():
    bpy.utils.register_module(__name__)
    library.register()
    config_path = bpy.utils.user_resource('CONFIG', 'my_addon')
    if os.path.exists(config_path):
        print("do config")

Which would rely on some sort of parsing of an external config file..
It's no use if you want prefs to go along with blend files rather than
be system specific.. And you end up having to write a lot of code just
to read / write prefs..




More information about the Bf-python mailing list