Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Jolly <zeograd>2021-01-25 07:51:36 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-01-25 07:51:36 +0300
commit5501a5de32db99a944fc6edfb02e3ba2d07de772 (patch)
treec35545580222c4cb73dccb339d1c9e8f12fee19b /source/blender/editors/space_sequencer/sequencer_edit.c
parente16c786022c48d9679ea306504c06ac25677e553 (diff)
Fix T84705: Snapping strip handle offset animation
Only offset animation if whole strip is snapped. Bug introduced in e36c05b3d191. Reviewed By: ISS Differential Revision: https://developer.blender.org/D10116
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 4f9fbc44631..f470d1913dc 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -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);
}
}