diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-09-26 11:33:31 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-09-26 11:33:31 +0400 |
commit | 7cf9c31272dbcb70b94925a1e4ab275844323353 (patch) | |
tree | b6d5e103e1906083599a83b4318f8ab63ec3b8da /source/blender/python/api2_2x/Constraint.c | |
parent | 1aef5641b3eb732dfad08cedae5a9e893455fc46 (diff) |
== Clamp To Constraint ==
Now there's an option for the owner to follow the path of the target cyclically. Previously, if the owner moved past the extents of the side of the bounding-box used for the calculations, the object was placed on the curve at the nearest extent.
This option is only really useful if the curve itself is cyclic, although you can still use it otherwise. To enable, just turn on the cyclic option.
Diffstat (limited to 'source/blender/python/api2_2x/Constraint.c')
-rw-r--r-- | source/blender/python/api2_2x/Constraint.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c index 0e235082c61..4dddd274a0e 100644 --- a/source/blender/python/api2_2x/Constraint.c +++ b/source/blender/python/api2_2x/Constraint.c @@ -125,6 +125,8 @@ enum constraint_constants { EXPP_CONSTR_LIMYROT = LIMIT_YROT, EXPP_CONSTR_LIMZROT = LIMIT_ZROT, + EXPP_CONSTR_CLAMPCYCLIC, + EXPP_CONSTR_XMIN, EXPP_CONSTR_XMAX, EXPP_CONSTR_YMIN, @@ -887,6 +889,8 @@ static PyObject *clampto_getter( BPy_Constraint * self, int type ) return Object_CreatePyObject( con->tar ); case EXPP_CONSTR_CLAMP: return PyInt_FromLong( (long)con->flag ); + case EXPP_CONSTR_CLAMPCYCLIC: + return PyBool_FromLong( (long)(con->flag2 & CLAMPTO_CYCLIC) ); default: return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" ); } @@ -908,6 +912,8 @@ static int clampto_setter( BPy_Constraint *self, int type, PyObject *value ) case EXPP_CONSTR_CLAMP: return EXPP_setIValueRange( value, &con->flag, CLAMPTO_AUTO, CLAMPTO_Z, 'i' ); + case EXPP_CONSTR_CLAMPCYCLIC: + return EXPP_setBitfield( value, &con->flag2, CLAMPTO_CYCLIC, 'i' ); default: return EXPP_ReturnIntError( PyExc_KeyError, "key not found" ); } @@ -2418,6 +2424,8 @@ static PyObject *M_Constraint_SettingsDict( void ) PyInt_FromLong( CLAMPTO_Y ) ); PyConstant_Insert( d, "CLAMPZ", PyInt_FromLong( CLAMPTO_Z ) ); + PyConstant_Insert( d, "CLAMPCYCLIC", + PyInt_FromLong( EXPP_CONSTR_CLAMPCYCLIC )); PyConstant_Insert( d, "TARGET", PyInt_FromLong( EXPP_CONSTR_TARGET ) ); |