Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2020-11-28 15:53:15 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2020-11-28 15:54:18 +0300
commit566e7e6145050ef73c2f7442eb6fda46f6e5c5d0 (patch)
tree8bfdada3a73b5f66874edb6d36015a68f6ec6618
parentc99d76773509516f1543190d422fb3be4c3021a4 (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.
-rw-r--r--source/blender/blenkernel/intern/curve.c15
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]);