diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-11-28 15:53:15 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2020-11-28 15:54:18 +0300 |
commit | 566e7e6145050ef73c2f7442eb6fda46f6e5c5d0 (patch) | |
tree | 8bfdada3a73b5f66874edb6d36015a68f6ec6618 /source/blender/blenkernel/intern/curve.c | |
parent | c99d76773509516f1543190d422fb3be4c3021a4 (diff) |
Fix Auto Clamped limits when smoothing the transition of cyclic curves.
The value of l[count-1] should be ready by the time hmin/hmax is computed.
Otherwise the left limit for the transition key would be scaled wrong.
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 3ad94853078..2df9f362b9c 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -3886,7 +3886,15 @@ static void bezier_handle_calc_smooth_fcurve( /* ratio of x intervals */ - l[0] = l[count - 1] = 1.0f; + if (full_cycle) { + dx[0] = dx[count - 1]; + dy[0] = dy[count - 1]; + + l[0] = l[count - 1] = dx[1] / dx[0]; + } + else { + l[0] = l[count - 1] = 1.0f; + } for (int i = 1; i < count - 1; i++) { l[i] = dx[i + 1] / dx[i]; @@ -3922,11 +3930,6 @@ static void bezier_handle_calc_smooth_fcurve( /* reduce the number of unknowns by one */ int i = solve_count = count - 1; - dx[0] = dx[i]; - dy[0] = dy[i]; - - l[0] = l[i] = dx[1] / dx[0]; - hmin[0] = max_ff(hmin[0], hmin[i]); hmax[0] = min_ff(hmax[0], hmax[i]); |