diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-07-17 16:03:17 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-07-17 16:03:17 +0400 |
commit | ff6c3dd0ae87b6524fb17a0a7a963a4c51bbbffd (patch) | |
tree | 92ecbae43daa93925e56b21828e049d1a690fc75 /source/blender/python/api2_2x/Constraint.c | |
parent | 1b0c72c3e5b890894c6d4ebc393d8e2b0644da06 (diff) |
== Constraints Work - PyAPI ==
A few tweaks to documentation and implementation of PyAPI access for constraints following Constraints recode. Just doing a little bit of cleanup.
Diffstat (limited to 'source/blender/python/api2_2x/Constraint.c')
-rw-r--r-- | source/blender/python/api2_2x/Constraint.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c index 8c7164fe999..0f94fa7195b 100644 --- a/source/blender/python/api2_2x/Constraint.c +++ b/source/blender/python/api2_2x/Constraint.c @@ -554,9 +554,19 @@ static int action_setter( BPy_Constraint *self, int type, PyObject *value ) case EXPP_CONSTR_END: return EXPP_setIValueClamped( value, &con->end, 1, MAXFRAME, 'h' ); case EXPP_CONSTR_MIN: - return EXPP_setFloatClamped( value, &con->min, -180.0, 180.0 ); + if (con->type < 10) + return EXPP_setFloatClamped( value, &con->min, -180.0, 180.0 ); + else if (con->type < 20) + return EXPP_setFloatClamped( value, &con->min, 0.0001, 1000.0 ); + else + return EXPP_setFloatClamped( value, &con->min, -1000.0, 1000.0 ); case EXPP_CONSTR_MAX: - return EXPP_setFloatClamped( value, &con->max, -180.0, 180.0 ); + if (con->type < 10) + return EXPP_setFloatClamped( value, &con->max, -180.0, 180.0 ); + else if (con->type < 20) + return EXPP_setFloatClamped( value, &con->max, 0.0001, 1000.0 ); + else + return EXPP_setFloatClamped( value, &con->max, -1000.0, 1000.0 ); case EXPP_CONSTR_KEYON: return EXPP_setIValueRange( value, &con->type, EXPP_CONSTR_XROT, EXPP_CONSTR_ZLOC, 'h' ); |