diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-05-16 20:46:20 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-05-16 20:46:20 +0300 |
commit | be84fe4ce1d8521ec91aa8bd6f56e9cdf4f7d8fe (patch) | |
tree | c8c1197f173c35441f500f89e330ae439422e969 /source/blender/editors/scene/scene_edit.c | |
parent | 205c6d8d0853ada1c3d087b31bb2bec42d5597f1 (diff) |
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
Diffstat (limited to 'source/blender/editors/scene/scene_edit.c')
-rw-r--r-- | source/blender/editors/scene/scene_edit.c | 12 |
1 files changed, 10 insertions, 2 deletions
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; } |