[Bf-blender-cvs] [7848bf0] master: Correct cu->pathlen treated as a float

Campbell Barton noreply at git.blender.org
Mon Aug 4 03:24:16 CEST 2014


Commit: 7848bf00b8fa2789f80b10f423c255f4aa4b5852
Author: Campbell Barton
Date:   Mon Aug 4 10:15:25 2014 +1000
Branches: master
https://developer.blender.org/rB7848bf00b8fa2789f80b10f423c255f4aa4b5852

Correct cu->pathlen treated as a float

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

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

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

diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 5281b0b..98a197b 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1994,17 +1994,20 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[4][4])
 		 * we divide the curvetime calculated in the previous step by the length of the path, to get a time
 		 * factor, which then gets clamped to lie within 0.0 - 1.0 range
 		 */
-		if (IS_EQF(cu->pathlen, 0.0f) == 0)
+		if (cu->pathlen) {
 			ctime = cu->ctime / cu->pathlen;
-		else
+		}
+		else {
 			ctime = cu->ctime;
+		}
 
 		CLAMP(ctime, 0.0f, 1.0f);
 	}
 	else {
 		ctime = BKE_scene_frame_get(scene);
-		if (IS_EQF(cu->pathlen, 0.0f) == 0)
+		if (cu->pathlen) {
 			ctime /= cu->pathlen;
+		}
 		
 		CLAMP(ctime, 0.0f, 1.0f);
 	}




More information about the Bf-blender-cvs mailing list