Fix T84705: Snapping strip handle offset animation

Only offset animation if whole strip is snapped.

Bug introduced in e36c05b3d1.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10116
This commit is contained in:
Olivier Jolly 2021-01-25 05:51:36 +01:00 committed by Richard Antalik
parent e16c786022
commit 5501a5de32
Notes: blender-bot 2023-02-13 19:53:28 +01:00
Referenced by issue #84705, VSE: snapping source strip right handle will incorrectly offset attached transform strip keyframes
1 changed files with 12 additions and 4 deletions

View File

@ -324,19 +324,27 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
}
}
/* Recalculate bounds of effect strips. */
/* Recalculate bounds of effect strips, offsetting the keyframes if not snapping any handle. */
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->type & SEQ_TYPE_EFFECT) {
const bool either_handle_selected = (seq->flag & (SEQ_LEFTSEL | SEQ_RIGHTSEL)) != 0;
if (seq->seq1 && (seq->seq1->flag & SELECT)) {
SEQ_offset_animdata(scene, seq, (snap_frame - seq->startdisp));
if (!either_handle_selected) {
SEQ_offset_animdata(scene, seq, (snap_frame - seq->startdisp));
}
SEQ_time_update_sequence(scene, seq);
}
else if (seq->seq2 && (seq->seq2->flag & SELECT)) {
SEQ_offset_animdata(scene, seq, (snap_frame - seq->startdisp));
if (!either_handle_selected) {
SEQ_offset_animdata(scene, seq, (snap_frame - seq->startdisp));
}
SEQ_time_update_sequence(scene, seq);
}
else if (seq->seq3 && (seq->seq3->flag & SELECT)) {
SEQ_offset_animdata(scene, seq, (snap_frame - seq->startdisp));
if (!either_handle_selected) {
SEQ_offset_animdata(scene, seq, (snap_frame - seq->startdisp));
}
SEQ_time_update_sequence(scene, seq);
}
}