Animation: Blend To Ease Slider #110566

Merged
Christoph Lendenfeld merged 21 commits from ChrisLend/blender:blend_to_ease_slider into main 2023-08-10 17:51:20 +02:00
1 changed files with 4 additions and 6 deletions
Showing only changes of commit 6ddc483989 - Show all commits

View File

@ -530,8 +530,6 @@ void blend_to_ease_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const flo
const float long_factor = factor * 2 - 1;
float y_delta = 0;
float base = 0;
for (int i = segment->start_index; i < segment->start_index + segment->length; i++) {
/* For easy calculation of the curve, the values are normalized. */
@ -540,13 +538,13 @@ void blend_to_ease_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const flo
if (slider_right_side) {
float ease = s_curve(normalized_x, 3, 2.0, 2.0, -1.0, -1.0);
base = left_key->vec[1][1] + key_y_range * ease;
y_delta = base - fcu->bezt[i].vec[1][1];
const float base = left_key->vec[1][1] + key_y_range * ease;
const float y_delta = base - fcu->bezt[i].vec[1][1];
}
else {
float ease = s_curve(normalized_x, 3, 2.0, 2.0, 0.0, 0.0);
base = left_key->vec[1][1] + key_y_range * ease;
y_delta = fcu->bezt[i].vec[1][1] - base;
const float base = left_key->vec[1][1] + key_y_range * ease;
const float y_delta = fcu->bezt[i].vec[1][1] - base;
}
const float key_y_value = fcu->bezt[i].vec[1][1] + y_delta * long_factor;