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.
This commit is contained in:
Ken Hughes
2006-12-27 18:39:39 +00:00
parent 7b93fff204
commit a5c188b4a6

View File

@@ -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] ) )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected a tuple of 3 floats" );
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 list or tuple of 3 floats" );
}
Py_DECREF( value );
switch( (int)type ) {
case EXPP_OBJ_ATTR_LOC:
dst = object->loc;