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:
@@ -4207,10 +4207,15 @@ static int setFloat3Attr( BPy_Object *self, PyObject *value, void *type )
|
|||||||
float *dst, param[3];
|
float *dst, param[3];
|
||||||
struct Object *object = self->object;
|
struct Object *object = self->object;
|
||||||
|
|
||||||
if( !PyArg_ParseTuple( value, "fff", ¶m[0], ¶m[1], ¶m[2] ) )
|
value = PySequence_Tuple( value );
|
||||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
|
||||||
"expected a tuple of 3 floats" );
|
|
||||||
|
|
||||||
|
if( !value || !PyArg_ParseTuple( value, "fff", ¶m[0], ¶m[1], ¶m[2] ) ) {
|
||||||
|
Py_XDECREF( value );
|
||||||
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
|
"expected a list or tuple of 3 floats" );
|
||||||
|
}
|
||||||
|
|
||||||
|
Py_DECREF( value );
|
||||||
switch( (int)type ) {
|
switch( (int)type ) {
|
||||||
case EXPP_OBJ_ATTR_LOC:
|
case EXPP_OBJ_ATTR_LOC:
|
||||||
dst = object->loc;
|
dst = object->loc;
|
||||||
|
|||||||
Reference in New Issue
Block a user