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:
-rw-r--r--source/creator/creator_args.c10
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;
}