[Bf-blender-cvs] [6f11cf2] object_nodes: Clamp the curve parameter in the curve path eval, because where_on_path is touchy about it.

Lukas Tönne noreply at git.blender.org
Fri Dec 11 10:00:02 CET 2015


Commit: 6f11cf240024013ca9e32215f093e33c4c3af3bb
Author: Lukas Tönne
Date:   Fri Dec 11 09:46:36 2015 +0100
Branches: object_nodes
https://developer.blender.org/rB6f11cf240024013ca9e32215f093e33c4c3af3bb

Clamp the curve parameter in the curve path eval, because where_on_path is touchy about it.

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

M	source/blender/blenvm/bvm/bvm_eval_curve.h

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

diff --git a/source/blender/blenvm/bvm/bvm_eval_curve.h b/source/blender/blenvm/bvm/bvm_eval_curve.h
index c7d8410..5d24cf3 100644
--- a/source/blender/blenvm/bvm/bvm_eval_curve.h
+++ b/source/blender/blenvm/bvm/bvm_eval_curve.h
@@ -52,6 +52,9 @@ static void eval_op_curve_path(float *stack, StackIndex offset_object, StackInde
 	PointerRNA ptr = stack_load_pointer(stack, offset_object);
 	float t = stack_load_float(stack, offset_param);
 	
+	/* where_on_path is touchy about 0 > t > 1 */
+	CLAMP(t, 0.0f, 1.0f);
+	
 	float3 loc(0, 0, 0), dir(0, 0, 0), nor(0, 0, 0);
 	matrix44 rot = matrix44::identity();
 	float radius=0.0f, weight=0.0f, tilt=0.0f;




More information about the Bf-blender-cvs mailing list