[Bf-blender-cvs] [566e7e61450] master: Fix Auto Clamped limits when smoothing the transition of cyclic curves.

Alexander Gavrilov noreply at git.blender.org
Sat Nov 28 13:57:31 CET 2020


Commit: 566e7e6145050ef73c2f7442eb6fda46f6e5c5d0
Author: Alexander Gavrilov
Date:   Sat Nov 28 15:53:15 2020 +0300
Branches: master
https://developer.blender.org/rB566e7e6145050ef73c2f7442eb6fda46f6e5c5d0

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.

===================================================================

M	source/blender/blenkernel/intern/curve.c

===================================================================

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]);



More information about the Bf-blender-cvs mailing list