[Bf-blender-cvs] [65dbfabaffb] smooth-curves: force fcurve AUTO handlers to use 1/3 of the distance for smoothness see: http://www.blender.org/forum/viewtopic.php?p=65508&sid=02e88fe6e3a43338ec8bc354991bc402

Dalai Felinto noreply at git.blender.org
Sat Apr 29 20:59:31 CEST 2017


Commit: 65dbfabaffb9299a3ce588f2e68fffee62d9ea64
Author: Dalai Felinto
Date:   Mon Nov 18 16:58:23 2013 -0200
Branches: smooth-curves
https://developer.blender.org/rB65dbfabaffb9299a3ce588f2e68fffee62d9ea64

force fcurve AUTO handlers to use 1/3 of the distance for smoothness
see: http://www.blender.org/forum/viewtopic.php?p=65508&sid=02e88fe6e3a43338ec8bc354991bc402

Note: this is also used by the curve code. The magic number 2.5614f
comes from review 290361776e5858b3903a83c0cddf722b8340e699

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

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

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

diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 439abb1d593..78176857027 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -3172,7 +3172,8 @@ static void calchandleNurb_intern(
 		tvec[2] = dvec_b[2] / len_b + dvec_a[2] / len_a;
 
 		if (is_fcurve) {
-			len = tvec[0];
+			/* force the handlers transition to be 1/3 */
+			len = 6.0f/2.5614f;
 		}
 		else {
 			len = len_v3(tvec);
@@ -3183,10 +3184,12 @@ static void calchandleNurb_intern(
 			/* only for fcurves */
 			bool leftviolate = false, rightviolate = false;
 
-			if (len_a > 5.0f * len_b)
-				len_a = 5.0f * len_b;
-			if (len_b > 5.0f * len_a)
-				len_b = 5.0f * len_a;
+			if (!is_fcurve) {
+				if (len_a > 5.0f * len_b)
+					len_a = 5.0f * len_b;
+				if (len_b > 5.0f * len_a)
+					len_b = 5.0f * len_a;
+			}
 
 			if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) {
 				len_a /= len;




More information about the Bf-blender-cvs mailing list