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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-09-24 16:41:12 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-09-24 16:48:50 +0300
commit8dfdd248b54b76c4a45db6f253398bc621142b42 (patch)
tree33f551efcc2fb3be1a3ac4565afb27a3dc5da12b /source/blender
parent8f51308dba0a5dc2f70c273e2de9fb7d102ed2f9 (diff)
Fix T56895: crash loading template with Load UI unchecked.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/layer.c11
-rw-r--r--source/blender/windowmanager/intern/wm_files.c5
2 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 707e1738af9..5b6a9f7092e 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -438,13 +438,16 @@ void BKE_view_layer_rename(Main *bmain, Scene *scene, ViewLayer *view_layer, con
}
}
- /* fix all the animation data and windows which may link to this */
+ /* Fix all the animation data and windows which may link to this. */
BKE_animdata_fix_paths_rename_all(NULL, "view_layers", oldname, view_layer->name);
+ /* WM can be missing on startup. */
wmWindowManager *wm = bmain->wm.first;
- for (wmWindow *win = wm->windows.first; win; win = win->next) {
- if (win->scene == scene && STREQ(win->view_layer_name, oldname)) {
- STRNCPY(win->view_layer_name, view_layer->name);
+ if (wm) {
+ for (wmWindow *win = wm->windows.first; win; win = win->next) {
+ if (win->scene == scene && STREQ(win->view_layer_name, oldname)) {
+ STRNCPY(win->view_layer_name, view_layer->name);
+ }
}
}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 231adfc746a..798b505e257 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1689,6 +1689,11 @@ static int wm_homefile_read_exec(bContext *C, wmOperator *op)
RNA_property_string_get(op->ptr, prop_app_template, app_template_buf);
app_template = app_template_buf;
+ if (!STREQ(app_template, U.app_template)) {
+ /* Always load UI when switching to another template. */
+ G.fileflags &= ~G_FILE_NO_UI;
+ }
+
/* Always load preferences when switching templates with own preferences. */
use_userdef = wm_app_template_has_userpref(app_template) ||
wm_app_template_has_userpref(U.app_template);