diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-06-14 22:55:59 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-06-14 22:55:59 +0300 |
commit | 20ba130315f3308907df463bb0a5d2676410921f (patch) | |
tree | 0e8d3c28dbaebb75139cd6bafc55cfedf69c655c /source/blender/editors | |
parent | a59fedb0bf7eb9215eb864a3772d922be4780138 (diff) |
Fix T72831: Incorrect animation handling when strips overlap
Function `SEQ_transform_seqbase_shuffle_time` did not have access to
strip effects, and therefore could not handle their animation. Since
now transformation knows what strips can't be directly moved, but their
position depends on other strips, this collection of strips is passed as
argument, so animation can be offset correctly.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_convert_sequencer.c | 33 |
2 files changed, 28 insertions, 11 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index ea6d3351eaa..647d13a4d56 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -340,7 +340,7 @@ static void seq_load_apply_generic_options(bContext *C, wmOperator *op, Sequence ScrArea *area = CTX_wm_area(C); const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag & SEQ_MARKER_TRANS) != 0; - SEQ_transform_handle_overlap(scene, ed->seqbasep, strip_col, use_sync_markers); + SEQ_transform_handle_overlap(scene, ed->seqbasep, strip_col, NULL, use_sync_markers); SEQ_collection_free(strip_col); } @@ -863,7 +863,7 @@ static void sequencer_add_movie_multiple_strips(bContext *C, ScrArea *area = CTX_wm_area(C); const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag & SEQ_MARKER_TRANS) != 0; - SEQ_transform_handle_overlap(scene, ed->seqbasep, strip_col, use_sync_markers); + SEQ_transform_handle_overlap(scene, ed->seqbasep, strip_col, NULL, use_sync_markers); } SEQ_collection_free(strip_col); @@ -913,7 +913,7 @@ static bool sequencer_add_movie_single_strip(bContext *C, ScrArea *area = CTX_wm_area(C); const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag & SEQ_MARKER_TRANS) != 0; - SEQ_transform_handle_overlap(scene, ed->seqbasep, strip_col, use_sync_markers); + SEQ_transform_handle_overlap(scene, ed->seqbasep, strip_col, NULL, use_sync_markers); } SEQ_collection_free(strip_col); diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c index 68f04aab969..4e3dd762993 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.c +++ b/source/blender/editors/transform/transform_convert_sequencer.c @@ -305,7 +305,9 @@ static SeqCollection *extract_standalone_strips(SeqCollection *transformed_strip } /* Query strips positioned after left edge of transformed strips bound-box. */ -static SeqCollection *query_right_side_strips(ListBase *seqbase, SeqCollection *transformed_strips) +static SeqCollection *query_right_side_strips(ListBase *seqbase, + SeqCollection *transformed_strips, + SeqCollection *time_dependent_strips) { int minframe = MAXFRAME; { @@ -317,6 +319,13 @@ static SeqCollection *query_right_side_strips(ListBase *seqbase, SeqCollection * SeqCollection *collection = SEQ_collection_create(__func__); LISTBASE_FOREACH (Sequence *, seq, seqbase) { + if (SEQ_collection_has_strip(seq, time_dependent_strips)) { + continue; + } + if (SEQ_collection_has_strip(seq, transformed_strips)) { + continue; + } + if ((seq->flag & SELECT) == 0 && SEQ_time_left_handle_frame_get(seq) >= minframe) { SEQ_collection_append_strip(seq, collection); } @@ -335,11 +344,13 @@ static ListBase *seqbase_active_get(const TransInfo *t) static void seq_transform_handle_expand_to_fit(Scene *scene, ListBase *seqbasep, SeqCollection *transformed_strips, + SeqCollection *time_dependent_strips, bool use_sync_markers) { ListBase *markers = &scene->markers; - SeqCollection *right_side_strips = query_right_side_strips(seqbasep, transformed_strips); + SeqCollection *right_side_strips = query_right_side_strips( + seqbasep, transformed_strips, time_dependent_strips); /* Temporarily move right side strips beyond timeline boundary. */ Sequence *seq; @@ -351,7 +362,7 @@ static void seq_transform_handle_expand_to_fit(Scene *scene, * strips on left side. */ SeqCollection *standalone_strips = extract_standalone_strips(transformed_strips); SEQ_transform_seqbase_shuffle_time( - standalone_strips, seqbasep, scene, markers, use_sync_markers); + standalone_strips, time_dependent_strips, seqbasep, scene, markers, use_sync_markers); SEQ_collection_free(standalone_strips); /* Move temporarily moved strips back to their original place and tag for shuffling. */ @@ -361,7 +372,7 @@ static void seq_transform_handle_expand_to_fit(Scene *scene, /* Shuffle again to displace strips on right side. Final effect shuffling is done in * SEQ_transform_handle_overlap. */ SEQ_transform_seqbase_shuffle_time( - right_side_strips, seqbasep, scene, markers, use_sync_markers); + right_side_strips, NULL, seqbasep, scene, markers, use_sync_markers); SEQ_collection_free(right_side_strips); } @@ -532,6 +543,7 @@ static void seq_transform_handle_overwrite(Scene *scene, static void seq_transform_handle_overlap_shuffle(Scene *scene, ListBase *seqbasep, SeqCollection *transformed_strips, + SeqCollection *time_dependent_strips, bool use_sync_markers) { ListBase *markers = &scene->markers; @@ -539,26 +551,29 @@ static void seq_transform_handle_overlap_shuffle(Scene *scene, /* Shuffle non strips with no effects attached. */ SeqCollection *standalone_strips = extract_standalone_strips(transformed_strips); SEQ_transform_seqbase_shuffle_time( - standalone_strips, seqbasep, scene, markers, use_sync_markers); + standalone_strips, time_dependent_strips, seqbasep, scene, markers, use_sync_markers); SEQ_collection_free(standalone_strips); } void SEQ_transform_handle_overlap(Scene *scene, ListBase *seqbasep, SeqCollection *transformed_strips, + SeqCollection *time_dependent_strips, bool use_sync_markers) { const eSeqOverlapMode overlap_mode = SEQ_tool_settings_overlap_mode_get(scene); switch (overlap_mode) { case SEQ_OVERLAP_EXPAND: - seq_transform_handle_expand_to_fit(scene, seqbasep, transformed_strips, use_sync_markers); + seq_transform_handle_expand_to_fit( + scene, seqbasep, transformed_strips, time_dependent_strips, use_sync_markers); break; case SEQ_OVERLAP_OVERWRITE: seq_transform_handle_overwrite(scene, seqbasep, transformed_strips); break; case SEQ_OVERLAP_SHUFFLE: - seq_transform_handle_overlap_shuffle(scene, seqbasep, transformed_strips, use_sync_markers); + seq_transform_handle_overlap_shuffle( + scene, seqbasep, transformed_strips, time_dependent_strips, use_sync_markers); break; } @@ -607,12 +622,14 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c return; } + TransSeq *ts = tc->custom.type.data; ListBase *seqbasep = seqbase_active_get(t); Scene *scene = t->scene; const bool use_sync_markers = (((SpaceSeq *)t->area->spacedata.first)->flag & SEQ_MARKER_TRANS) != 0; if (seq_transform_check_overlap(transformed_strips)) { - SEQ_transform_handle_overlap(scene, seqbasep, transformed_strips, use_sync_markers); + SEQ_transform_handle_overlap( + scene, seqbasep, transformed_strips, ts->time_dependent_strips, use_sync_markers); } SEQ_collection_free(transformed_strips); |