Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Fri, 27 Jul 2018 07:09:38 +0000 (17:09 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 27 Jul 2018 07:09:38 +0000 (17:09 +1000)
1  2 
source/creator/creator_args.c

index da5dcf9ff8b1f9a5beedccb7a70714e246a2cc90,22301bd62f54088af3e014537e00b4ea741b5e47..283585598bf885e835fa1d0c2c7bcc2b2f62c790
@@@ -1448,6 -1590,16 +1448,16 @@@ static int arg_handle_scene_set(int arg
                Scene *scene = BKE_scene_set_name(CTX_data_main(C), argv[1]);
                if (scene) {
                        CTX_data_scene_set(C, scene);
 -                              win->screen->scene = 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;
        }