Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Hughes <khughes@pacific.edu>2006-12-27 21:39:39 +0300
committerKen Hughes <khughes@pacific.edu>2006-12-27 21:39:39 +0300
commita5c188b4a6975b3f39a535ff9da292080a452b3c (patch)
tree66f91d0120badb833e31d74b147d4185744fc546 /source/blender/python/api2_2x/Object.c
parent7b93fff2040f317233fc023540487f757dcd3e99 (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/Object.c')
-rw-r--r--source/blender/python/api2_2x/Object.c9
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", &param[0], &param[1], &param[2] ) )
+ value = PySequence_Tuple( value );
+
+ if( !value || !PyArg_ParseTuple( value, "fff", &param[0], &param[1], &param[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;