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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-06 17:25:28 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-06 17:25:28 +0300
commitbb7202495a289370fe39a9aaeebf8d21fa7d357c (patch)
treea7fd7b43a423ee3bc5fd106bba9a98a52de76262 /source/blender/windowmanager/intern
parent19d651ca9a694f556c76a09c2822b81ae1dc18a5 (diff)
parent48e871ab1d57ef2e95047b2be5718cee5d3cefe6 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/collada/ArmatureExporter.cpp source/blender/collada/ArmatureExporter.h source/blender/collada/DocumentExporter.cpp source/blender/collada/DocumentExporter.h source/blender/collada/SceneExporter.cpp source/blender/collada/SceneExporter.h source/blender/collada/collada.cpp source/blender/collada/collada.h source/blender/editors/armature/armature_edit.c source/blender/editors/armature/editarmature_retarget.c source/blender/editors/armature/pose_transform.c source/blender/editors/include/ED_armature.h source/blender/editors/include/ED_object.h source/blender/editors/include/ED_screen.h source/blender/editors/io/io_collada.c source/blender/editors/object/object_transform.c source/blender/editors/screen/screen_edit.c source/blender/editors/screen/screen_ops.c source/blender/windowmanager/intern/wm.c source/blender/windowmanager/intern/wm_files.c source/blender/windowmanager/intern/wm_window.c source/blenderplayer/bad_level_call_stubs/stubs.c
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm.c3
-rw-r--r--source/blender/windowmanager/intern/wm_files.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index b6a12acd57d..9100e47d820 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -394,6 +394,7 @@ void WM_keymap_init(bContext *C)
void WM_check(bContext *C)
{
+ Main *bmain = CTX_data_main(C);
wmWindowManager *wm = CTX_wm_manager(C);
/* wm context */
@@ -424,7 +425,7 @@ void WM_check(bContext *C)
/* case: fileread */
/* note: this runs in bg mode to set the screen context cb */
if ((wm->initialized & WM_WINDOW_IS_INITIALIZED) == 0) {
- ED_screens_initialize(wm);
+ ED_screens_initialize(bmain, wm);
wm->initialized |= WM_WINDOW_IS_INITIALIZED;
}
}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 088aca05268..315a3d715ea 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -572,7 +572,6 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* we didn't succeed, now try to read Blender file */
if (retval == BKE_READ_EXOTIC_OK_BLEND) {
- Main *bmain = CTX_data_main(C);
int G_f = G.f;
ListBase wmbase;
@@ -583,6 +582,10 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* confusing this global... */
G.relbase_valid = 1;
retval = BKE_blendfile_read(C, filepath, reports, 0);
+
+ /* BKE_file_read sets new Main into context. */
+ Main *bmain = CTX_data_main(C);
+
/* when loading startup.blend's, we can be left with a blank path */
if (BKE_main_blendfile_path(bmain)) {
G.save_over = 1;
@@ -600,12 +603,12 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
}
/* match the read WM with current WM */
- wm_window_match_do(C, &wmbase, &G.main->wm, &G.main->wm);
+ wm_window_match_do(C, &wmbase, &bmain->wm, &bmain->wm);
WM_check(C); /* opens window(s), checks keymaps */
if (retval == BKE_BLENDFILE_READ_OK_USERPREFS) {
/* in case a userdef is read from regular .blend */
- wm_init_userdef(G.main, false);
+ wm_init_userdef(bmain, false);
}
if (retval != BKE_BLENDFILE_READ_FAIL) {