Fix T73014: Marker sync does not work correctly if moving strip so it overlaps another strip

Need to also offset markers in BKE_sequence_base_shuffle_time().
Also clarify/correct related comments.

Maniphest Tasks: T73014

Differential Revision: https://developer.blender.org/D6555
This commit is contained in:
Philipp Oeser 2020-01-10 13:33:25 +01:00
parent 67a6050499
commit aa123555d7
Notes: blender-bot 2023-02-14 11:20:29 +01:00
Referenced by issue #73014, Marker sync does not work correctly if moving strip so it overlaps another strip
5 changed files with 28 additions and 8 deletions

View File

@ -413,7 +413,10 @@ bool BKE_sequence_base_shuffle_ex(struct ListBase *seqbasep,
bool BKE_sequence_base_shuffle(struct ListBase *seqbasep,
struct Sequence *test,
struct Scene *evil_scene);
bool BKE_sequence_base_shuffle_time(ListBase *seqbasep, struct Scene *evil_scene);
bool BKE_sequence_base_shuffle_time(ListBase *seqbasep,
struct Scene *evil_scene,
ListBase *markers,
const bool use_sync_markers);
bool BKE_sequence_base_isolated_sel_check(struct ListBase *seqbase);
void BKE_sequencer_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, bool for_render);
struct Sequence *BKE_sequence_dupli_recursive(const struct Scene *scene_src,

View File

@ -4919,7 +4919,10 @@ static int shuffle_seq_time_offset(Scene *scene, ListBase *seqbasep, char dir)
return tot_ofs;
}
bool BKE_sequence_base_shuffle_time(ListBase *seqbasep, Scene *evil_scene)
bool BKE_sequence_base_shuffle_time(ListBase *seqbasep,
Scene *evil_scene,
ListBase *markers,
const bool use_sync_markers)
{
/* note: seq->tmp is used to tag strips to move */
@ -4936,6 +4939,16 @@ bool BKE_sequence_base_shuffle_time(ListBase *seqbasep, Scene *evil_scene)
seq->flag &= ~SEQ_OVERLAP;
}
}
if (use_sync_markers && !(evil_scene->toolsettings->lock_markers) && (markers != NULL)) {
TimeMarker *marker;
/* affect selected markers - it's unlikely that we will want to affect all in this way? */
for (marker = markers->first; marker; marker = marker->next) {
if (marker->flag & SELECT) {
marker->frame += offset;
}
}
}
}
return offset ? false : true;

View File

@ -2561,7 +2561,7 @@ int transformEnd(bContext *C, TransInfo *t)
/* aftertrans does insert keyframes, and clears base flags; doesn't read transdata */
special_aftertrans_update(C, t);
/* free data */
/* Free data, also handles overlap [in freeTransCustomData()]. */
postTrans(C, t);
/* send events out for redraws */

View File

@ -1892,8 +1892,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
SpaceSeq *sseq = (SpaceSeq *)t->sa->spacedata.first;
/* marker transform, not especially nice but we may want to move markers
* at the same time as keyframes in the dope sheet. */
/* Marker transform, not especially nice but we may want to move markers
* at the same time as strips in the Video Sequencer. */
if ((sseq->flag & SEQ_MARKER_TRANS) && (canceled == 0)) {
/* cant use TFM_TIME_EXTEND
* for some reason EXTEND is changed into TRANSLATE, so use frame_side instead */

View File

@ -381,6 +381,10 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c
}
if (overlap) {
const bool use_sync_markers = (((SpaceSeq *)t->sa->spacedata.first)->flag &
SEQ_MARKER_TRANS) != 0;
ListBase *markers = &t->scene->markers;
bool has_effect_root = false, has_effect_any = false;
for (seq = seqbasep->first; seq; seq = seq->next) {
seq->tmp = NULL;
@ -425,7 +429,7 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c
}
}
BKE_sequence_base_shuffle_time(seqbasep, t->scene);
BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers);
for (seq = seqbasep->first; seq; seq = seq->next) {
if (seq->machine >= MAXSEQ * 2) {
@ -437,10 +441,10 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c
}
}
BKE_sequence_base_shuffle_time(seqbasep, t->scene);
BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers);
}
else {
BKE_sequence_base_shuffle_time(seqbasep, t->scene);
BKE_sequence_base_shuffle_time(seqbasep, t->scene, markers, use_sync_markers);
}
if (has_effect_any) {