From b48c514db87d360ddfcadfcde582c0cae9344d6c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 6 Nov 2006 23:51:37 +0000 Subject: Added an option in the IK constraint to disable stretching, useful in rigs with layered IK constraints. Also removed the tolerance setting, this value wasn't used in the solver anymore. --- source/blender/python/api2_2x/Constraint.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/python/api2_2x/Constraint.c') diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c index 2657ed51a72..e8a0566c89e 100644 --- a/source/blender/python/api2_2x/Constraint.c +++ b/source/blender/python/api2_2x/Constraint.c @@ -67,7 +67,7 @@ enum constraint_constants { EXPP_CONSTR_MINZ = TRACK_nZ, EXPP_CONSTR_TARGET = 100, - EXPP_CONSTR_TOLERANCE, + EXPP_CONSTR_STRETCH, EXPP_CONSTR_ITERATIONS, EXPP_CONSTR_BONE, EXPP_CONSTR_CHAINLEN, @@ -390,8 +390,8 @@ static PyObject *kinematic_getter( BPy_Constraint * self, int type ) return Object_CreatePyObject( con->tar ); case EXPP_CONSTR_BONE: return PyString_FromString( con->subtarget ); - case EXPP_CONSTR_TOLERANCE: - return PyFloat_FromDouble( (double)con->tolerance ); + case EXPP_CONSTR_STRETCH: + return PyBool_FromLong( (long)( con->flag & CONSTRAINT_IK_STRETCH ) ) ; case EXPP_CONSTR_ITERATIONS: return PyInt_FromLong( (long)con->iterations ); case EXPP_CONSTR_CHAINLEN: @@ -432,8 +432,8 @@ static int kinematic_setter( BPy_Constraint *self, int type, PyObject *value ) return 0; } - case EXPP_CONSTR_TOLERANCE: - return EXPP_setFloatClamped( value, &con->tolerance, 0.0001, 1.0 ); + case EXPP_CONSTR_STRETCH: + return EXPP_setBitfield( value, &con->flag, CONSTRAINT_IK_STRETCH, 'h' ); case EXPP_CONSTR_ITERATIONS: return EXPP_setIValueClamped( value, &con->iterations, 1, 10000, 'h' ); case EXPP_CONSTR_CHAINLEN: @@ -1829,8 +1829,8 @@ static PyObject *M_Constraint_SettingsDict( void ) PyConstant_Insert( d, "TARGET", PyInt_FromLong( EXPP_CONSTR_TARGET ) ); - PyConstant_Insert( d, "TOLERANCE", - PyInt_FromLong( EXPP_CONSTR_TOLERANCE ) ); + PyConstant_Insert( d, "STRETCH", + PyInt_FromLong( EXPP_CONSTR_STRETCH ) ); PyConstant_Insert( d, "ITERATIONS", PyInt_FromLong( EXPP_CONSTR_ITERATIONS ) ); PyConstant_Insert( d, "BONE", -- cgit v1.2.3