diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-24 08:45:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-24 08:45:36 +0400 |
commit | 3b9b6051d93122a27da57908c987670e9f831e7f (patch) | |
tree | b620d0cdde60247df6585058af36bcc89c0e2bb6 /source/blender/python/mathutils/mathutils_Color.c | |
parent | c62d33c540830188207bc32d5e3fc5a2134f5ab1 (diff) |
rename mathutils constructors to match other parts of the bpy/api (no functional changes)
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Color.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Color.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 79628cf5ae9..8409344a9fe 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -61,7 +61,7 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds) "more then a single arg given"); return NULL; } - return newColorObject(col, Py_NEW, type); + return Color_CreatePyObject(col, Py_NEW, type); } //-----------------------------METHODS---------------------------- @@ -104,7 +104,7 @@ static PyObject *Color_copy(ColorObject *self) if (BaseMath_ReadCallback(self) == -1) return NULL; - return newColorObject(self->col, Py_NEW, Py_TYPE(self)); + return Color_CreatePyObject(self->col, Py_NEW, Py_TYPE(self)); } //----------------------------print object (internal)-------------- @@ -384,7 +384,7 @@ static PyObject *Color_add(PyObject *v1, PyObject *v2) add_vn_vnvn(col, color1->col, color2->col, COLOR_SIZE); - return newColorObject(col, Py_NEW, Py_TYPE(v1)); + return Color_CreatePyObject(col, Py_NEW, Py_TYPE(v1)); } /* addition in-place: obj += obj */ @@ -433,7 +433,7 @@ static PyObject *Color_sub(PyObject *v1, PyObject *v2) sub_vn_vnvn(col, color1->col, color2->col, COLOR_SIZE); - return newColorObject(col, Py_NEW, Py_TYPE(v1)); + return Color_CreatePyObject(col, Py_NEW, Py_TYPE(v1)); } /* subtraction in-place: obj -= obj */ @@ -465,7 +465,7 @@ static PyObject *color_mul_float(ColorObject *color, const float scalar) { float tcol[COLOR_SIZE]; mul_vn_vn_fl(tcol, color->col, COLOR_SIZE, scalar); - return newColorObject(tcol, Py_NEW, Py_TYPE(color)); + return Color_CreatePyObject(tcol, Py_NEW, Py_TYPE(color)); } @@ -612,7 +612,7 @@ static PyObject *Color_neg(ColorObject *self) return NULL; negate_vn_vn(tcol, self->col, COLOR_SIZE); - return newColorObject(tcol, Py_NEW, Py_TYPE(self)); + return Color_CreatePyObject(tcol, Py_NEW, Py_TYPE(self)); } @@ -821,13 +821,13 @@ PyTypeObject color_Type = { NULL, //tp_weaklist NULL //tp_del }; -//------------------------newColorObject (internal)------------- +//------------------------Color_CreatePyObject (internal)------------- //creates a new color object /*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newColorObject(float *col, int type, PyTypeObject *base_type) +PyObject *Color_CreatePyObject(float *col, int type, PyTypeObject *base_type) { ColorObject *self; @@ -860,9 +860,9 @@ PyObject *newColorObject(float *col, int type, PyTypeObject *base_type) return (PyObject *)self; } -PyObject *newColorObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) +PyObject *Color_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) { - ColorObject *self= (ColorObject *)newColorObject(NULL, Py_NEW, NULL); + ColorObject *self= (ColorObject *)Color_CreatePyObject(NULL, Py_NEW, NULL); if (self) { Py_INCREF(cb_user); self->cb_user= cb_user; |