diff options
author | Ken Hughes <khughes@pacific.edu> | 2006-12-27 21:39:39 +0300 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2006-12-27 21:39:39 +0300 |
commit | a5c188b4a6975b3f39a535ff9da292080a452b3c (patch) | |
tree | 66f91d0120badb833e31d74b147d4185744fc546 /source/blender/python/api2_2x | |
parent | 7b93fff2040f317233fc023540487f757dcd3e99 (diff) |
Python API
----------
Bugfix. Refactor from a few months ago broke ob.loc; it only accepted a tuple
of 3 floats instead of a list. Make it accept both types now.
Diffstat (limited to 'source/blender/python/api2_2x')
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 87acb90c5fe..adf6abd28d7 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -4207,10 +4207,15 @@ static int setFloat3Attr( BPy_Object *self, PyObject *value, void *type ) float *dst, param[3]; struct Object *object = self->object; - if( !PyArg_ParseTuple( value, "fff", ¶m[0], ¶m[1], ¶m[2] ) ) + value = PySequence_Tuple( value ); + + if( !value || !PyArg_ParseTuple( value, "fff", ¶m[0], ¶m[1], ¶m[2] ) ) { + Py_XDECREF( value ); return EXPP_ReturnIntError( PyExc_TypeError, - "expected a tuple of 3 floats" ); + "expected a list or tuple of 3 floats" ); + } + Py_DECREF( value ); switch( (int)type ) { case EXPP_OBJ_ATTR_LOC: dst = object->loc; |