diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-27 10:09:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-27 10:09:38 +0300 |
commit | 2032e4ec9edd33235bb496e7828dcc2fd7210ac0 (patch) | |
tree | f398edca1430d9b79beb0f7ad1b2226cb9e4d3e5 /source/creator | |
parent | b8ab2a84d3238fcefb67b903848696bee7b5daec (diff) | |
parent | 3e2dfc6db8e01ffa5e12a8e9b300ef6509a06552 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/creator_args.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index da5dcf9ff8b..283585598bf 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -1448,6 +1448,16 @@ static int arg_handle_scene_set(int argc, const char **argv, void *data) Scene *scene = BKE_scene_set_name(CTX_data_main(C), argv[1]); if (scene) { CTX_data_scene_set(C, scene); + + /* Set the scene of the first window, see: T55991, + * otherwise scrips that run later won't get this scene back from the context. */ + wmWindow *win = CTX_wm_window(C); + if (win == NULL) { + win = CTX_wm_manager(C)->windows.first; + } + if (win != NULL) { + WM_window_set_active_scene(CTX_data_main(C), C, win, scene); + } } return 1; } |