diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-13 08:52:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-13 08:52:56 +0400 |
commit | 18702a9eef23e2c9ba8436194aa5536cf424bd9f (patch) | |
tree | 1314b934e4a61573455b5324813bc95f285838bb /source | |
parent | 9153e82d210fbe47fc2ede39369e87c45445470f (diff) |
bugfix [#23001] Addons do not unregister properly in Blender 2.5.3
Now reloading the user defaults also unloads/loads addons, resetting the state to the one set in the user preferences.
moved addon functions into bpy.utils
- bpy.utils.addon_enable(name, default_set=True)
- bpy.utils.addon_disable(name, default_set=True)
- bpy.utils.addon_reset_all(name, default_set=True)
the user preference operators now just wrap these.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 1a044c653a3..038270ae58a 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -405,6 +405,13 @@ int WM_read_homefile(bContext *C, wmOperator *op) ED_editors_init(C); DAG_on_load_update(CTX_data_main(C)); + +#ifndef DISABLE_PYTHON + if(CTX_py_init_get(C)) { + /* sync addons, these may have changed from the defaults */ + BPY_eval_string(C, "__import__('bpy').utils.addon_reset_all()"); + } +#endif WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL); CTX_wm_window_set(C, NULL); /* exits queues */ |