From be84fe4ce1d8521ec91aa8bd6f56e9cdf4f7d8fe Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 16 May 2022 19:46:20 +0200 Subject: VSE: Add new Scene and Strip This operator allows to add a new scene at the same time that the strip. This is very handy for storyboarding. Reviewed By: ISS Maniphest Tasks: T97678 Differential Revision: https://developer.blender.org/D14790 --- source/blender/editors/scene/scene_edit.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/scene') diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index a13177942a8..57a9e6be917 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -67,7 +67,10 @@ static Scene *scene_add(Main *bmain, Scene *scene_old, eSceneCopyMethod method) } /** Add a new scene in the sequence editor. */ -static Scene *ED_scene_sequencer_add(Main *bmain, bContext *C, eSceneCopyMethod method) +Scene *ED_scene_sequencer_add(Main *bmain, + bContext *C, + eSceneCopyMethod method, + const bool assign_strip) { Sequence *seq = NULL; Scene *scene_active = CTX_data_scene(C); @@ -88,6 +91,11 @@ static Scene *ED_scene_sequencer_add(Main *bmain, bContext *C, eSceneCopyMethod Scene *scene_new = scene_add(bmain, scene_strip, method); + /* If don't need assign the scene to the strip, nothing else to do. */ + if (!assign_strip) { + return scene_new; + } + /* As the scene is created in sequencer, do not set the new scene as active. * This is useful for story-boarding where we want to keep actual scene active. * The new scene is linked to the active strip and the viewport updated. */ @@ -291,7 +299,7 @@ static int scene_new_sequencer_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); int type = RNA_enum_get(op->ptr, "type"); - if (ED_scene_sequencer_add(bmain, C, type) == NULL) { + if (ED_scene_sequencer_add(bmain, C, type, true) == NULL) { return OPERATOR_CANCELLED; } -- cgit v1.2.3