diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-07-08 18:44:24 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-07-08 19:07:07 +0300 |
commit | 2ee68917287627a3803a8eae91d4d788ac316185 (patch) | |
tree | 4a18945e4485fee7b2529aa4837083df7af30bda /source/blender/sequencer/intern | |
parent | d8e980a4a6f132aba13713efb89ec3013976c4a1 (diff) |
Fix T99494: Transition effects not working correctly
This was caused by strip content length and start position being
incorrect. Previously this was set from strip boundary by update
function, but it was removed.
Add back code to set effect strip start and length.
Previously content length was always 1 for effects, but now it must
correspond to strip length. Because of this workaround for speed effect
to get this apparent content length was removed.
Diffstat (limited to 'source/blender/sequencer/intern')
-rw-r--r-- | source/blender/sequencer/intern/effects.c | 23 | ||||
-rw-r--r-- | source/blender/sequencer/intern/strip_time.c | 2 |
2 files changed, 5 insertions, 20 deletions
diff --git a/source/blender/sequencer/intern/effects.c b/source/blender/sequencer/intern/effects.c index 2ab8b170ce9..25a6acb8975 100644 --- a/source/blender/sequencer/intern/effects.c +++ b/source/blender/sequencer/intern/effects.c @@ -2578,21 +2578,6 @@ static int early_out_speed(Sequence *UNUSED(seq), float UNUSED(fac)) return EARLY_DO_EFFECT; } -/** - * Generator strips with zero inputs have their length set to 1 permanently. In some cases it is - * useful to use speed effect on these strips because they can be animated. This can be done by - * using their length as is on timeline as content length. See T82698. - */ -static int seq_effect_speed_get_strip_content_length(Scene *scene, const Sequence *seq) -{ - if ((seq->type & SEQ_TYPE_EFFECT) != 0 && SEQ_effect_get_num_inputs(seq->type) == 0) { - return SEQ_time_right_handle_frame_get(scene, seq) - - SEQ_time_left_handle_frame_get(scene, seq); - } - - return SEQ_time_strip_length_get(scene, seq); -} - static FCurve *seq_effect_speed_speed_factor_curve_get(Scene *scene, Sequence *seq) { return id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "speed_factor", 0, NULL); @@ -2657,8 +2642,7 @@ float seq_speed_effect_target_frame_get(Scene *scene, switch (s->speed_control_type) { case SEQ_SPEED_STRETCH: { /* Only right handle controls effect speed! */ - const float target_content_length = seq_effect_speed_get_strip_content_length(scene, - source) - + const float target_content_length = SEQ_time_strip_length_get(scene, source) - source->startofs; const float speed_effetct_length = SEQ_time_right_handle_frame_get(scene, seq_speed) - SEQ_time_left_handle_frame_get(scene, seq_speed); @@ -2678,15 +2662,14 @@ float seq_speed_effect_target_frame_get(Scene *scene, break; } case SEQ_SPEED_LENGTH: - target_frame = seq_effect_speed_get_strip_content_length(scene, source) * - (s->speed_fader_length / 100.0f); + target_frame = SEQ_time_strip_length_get(scene, source) * (s->speed_fader_length / 100.0f); break; case SEQ_SPEED_FRAME_NUMBER: target_frame = s->speed_fader_frame_number; break; } - CLAMP(target_frame, 0, seq_effect_speed_get_strip_content_length(scene, source)); + CLAMP(target_frame, 0, SEQ_time_strip_length_get(scene, source)); target_frame += seq_speed->start; /* No interpolation. */ diff --git a/source/blender/sequencer/intern/strip_time.c b/source/blender/sequencer/intern/strip_time.c index aa51813c9b8..5d8266dbc6e 100644 --- a/source/blender/sequencer/intern/strip_time.c +++ b/source/blender/sequencer/intern/strip_time.c @@ -203,6 +203,8 @@ void seq_time_effect_range_set(const Scene *scene, Sequence *seq) /* Values unusable for effects, these should be always 0. */ seq->startofs = seq->endofs = seq->anim_startofs = seq->anim_endofs = 0; + seq->start = seq->startdisp; + seq->len = seq->enddisp - seq->startdisp; } /* Update strip startdisp and enddisp (n-input effects have no len to calculate these). */ |