diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-06-30 19:26:14 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-06-30 19:33:34 +0300 |
commit | 66de653784ab06ccea46413de6b2f086b5a69d30 (patch) | |
tree | 28b7f684198cd9f80d0b889979dafacaa9412228 /source/blender/sequencer/intern | |
parent | 79fe27b976dde09b83e801a0e80f40010617c256 (diff) |
Fix incorrect strip position if pitch was animated
Commit 302b04a5a3fc introduced new retiming system, that unified sound
pitch animation with strip speed control. Because sound playback is
handled in different way, this did not work as expected and old files
were broken. In addition animation was not copied to new property.
Revert length position and offset handling for sound strips so their
position does not change and remap fcurves to new `speed_factor`
property.
Diffstat (limited to 'source/blender/sequencer/intern')
-rw-r--r-- | source/blender/sequencer/intern/strip_time.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/sequencer/intern/strip_time.c b/source/blender/sequencer/intern/strip_time.c index d4357fe28b6..aa51813c9b8 100644 --- a/source/blender/sequencer/intern/strip_time.c +++ b/source/blender/sequencer/intern/strip_time.c @@ -437,15 +437,20 @@ bool SEQ_time_strip_intersects_frame(const Scene *scene, void SEQ_time_speed_factor_set(const Scene *scene, Sequence *seq, const float speed_factor) { - const float left_handle_frame = SEQ_time_left_handle_frame_get(scene, seq); - const float unity_start_offset = seq->startofs * seq->speed_factor; - const float unity_end_offset = seq->endofs * seq->speed_factor; - /* Left handle is pivot point for content scaling - it must always show same frame. */ - seq->speed_factor = speed_factor; - seq->startofs = unity_start_offset / speed_factor; - seq->start = left_handle_frame - seq->startofs; - seq->endofs = unity_end_offset / speed_factor; + if (seq->type == SEQ_TYPE_SOUND_RAM) { + seq->speed_factor = speed_factor; + } + else { + const float left_handle_frame = SEQ_time_left_handle_frame_get(scene, seq); + const float unity_start_offset = seq->startofs * seq->speed_factor; + const float unity_end_offset = seq->endofs * seq->speed_factor; + /* Left handle is pivot point for content scaling - it must always show same frame. */ + seq->speed_factor = speed_factor; + seq->startofs = unity_start_offset / speed_factor; + seq->start = left_handle_frame - seq->startofs; + seq->endofs = unity_end_offset / speed_factor; + } SEQ_time_update_meta_strip_range(scene, seq_sequence_lookup_meta_by_seq(scene, seq)); seq_time_update_effects_strip_range(scene, seq_sequence_lookup_effects_by_seq(scene, seq)); @@ -471,6 +476,10 @@ bool SEQ_time_has_still_frames(const Scene *scene, const Sequence *seq) * factor */ int SEQ_time_strip_length_get(const Scene *scene, const Sequence *seq) { + if (seq->type == SEQ_TYPE_SOUND_RAM) { + return seq->len; + } + return seq->len / seq_time_playback_rate_factor_get(scene, seq); } |