mathutils: refactor instantiation

remove 'type' argument, very few mathutils objects are wrapped,
add new function for creating wrapped objects.

also fixes unlikely memory leak if the data-array can't be allocated.
This commit is contained in:
2015-01-04 17:03:54 +11:00
parent c41431f1e9
commit 8106a6b75d
29 changed files with 499 additions and 331 deletions

View File

@@ -153,7 +153,7 @@ static PyObject *Freestyle_blendRamp(PyObject *self, PyObject *args)
return NULL;
}
ramp_blend(type, a, fac, b);
return Vector_CreatePyObject(a, 3, Py_NEW, NULL);
return Vector_CreatePyObject(a, 3, NULL);
}
#include "BKE_texture.h" /* do_colorband() */
@@ -187,7 +187,7 @@ static PyObject *Freestyle_evaluateColorRamp(PyObject *self, PyObject *args)
PyErr_SetString(PyExc_ValueError, "failed to evaluate the color ramp");
return NULL;
}
return Vector_CreatePyObject(out, 4, Py_NEW, NULL);
return Vector_CreatePyObject(out, 4, NULL);
}
#include "DNA_color_types.h"