Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 42d17387d77..090c28a81a6 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -580,7 +580,10 @@ static void wm_file_read_post(bContext *C,
#ifdef WITH_PYTHON
if (is_startup_file) {
- /* possible python hasn't been initialized */
+ /* On startup (by default), Python won't have been initialized.
+ *
+ * The following block handles data & preferences being reloaded
+ * which requires resetting some internal variables. */
if (CTX_py_init_get(C)) {
bool reset_all = use_userdef;
if (use_userdef || reset_app_template) {
@@ -592,8 +595,16 @@ static void wm_file_read_post(bContext *C,
}
}
if (reset_all) {
- /* sync addons, these may have changed from the defaults */
- BPY_run_string_eval(C, (const char *[]){"addon_utils", NULL}, "addon_utils.reset_all()");
+ BPY_run_string_exec(
+ C,
+ (const char *[]){"bpy", "addon_utils", NULL},
+ /* Refresh scripts as the preferences may have changed the user-scripts path.
+ *
+ * This is needed when loading settings from the previous version,
+ * otherwise the script path stored in the preferences would be ignored. */
+ "bpy.utils.refresh_script_paths()\n"
+ /* Sync add-ons, these may have changed from the defaults. */
+ "addon_utils.reset_all()");
}
if (use_data) {
BPY_python_reset(C);