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.
This commit is contained in:
parent
d8e980a4a6
commit
2ee6891728
Notes:
blender-bot
2023-02-14 02:27:56 +01:00
Referenced by issue #102328, Regression: VSE - Strips with crossfade - the crossfade is not copied correctly - "should never happen" Referenced by issue #99655, VSE: fade in/ fade out effect in master is broken Referenced by issue #99494, Regression: Wipe Transition not working
|
@ -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. */
|
||||
|
|
|
@ -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). */
|
||||
|
|
Loading…
Reference in New Issue