Freestyle: use mathutils_array_parse() instead of its own helper functions.

Patch contribution by flokkievids (Folkert de Vries).  Thanks!
This commit is contained in:
2014-06-24 22:48:15 +09:00
parent 252eaed483
commit 9563bde9a5
10 changed files with 64 additions and 46 deletions

View File

@@ -138,14 +138,16 @@ static PyObject *Freestyle_blendRamp(PyObject *self, PyObject *args)
PyErr_SetString(PyExc_TypeError, "argument 1 is an unknown ramp blend type");
return NULL;
}
if (!float_array_from_PyObject(obj1, a, 3)) {
PyErr_SetString(PyExc_TypeError,
"argument 2 must be a 3D vector (either a tuple/list of 3 elements or Vector)");
if (mathutils_array_parse(a, 3, 3, obj1,
"argument 2 must be a 3D vector "
"(either a tuple/list of 3 elements or Vector)") == -1)
{
return NULL;
}
if (!float_array_from_PyObject(obj2, b, 3)) {
PyErr_SetString(PyExc_TypeError,
"argument 4 must be a 3D vector (either a tuple/list of 3 elements or Vector)");
if (mathutils_array_parse(b, 3, 3, obj2,
"argument 4 must be a 3D vector "
"(either a tuple/list of 3 elements or Vector)") == -1)
{
return NULL;
}
ramp_blend(type, a, fac, b);