Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-30 15:35:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-30 15:35:58 +0400
commit89b83f00608dfb2a7750476035f0635885473d21 (patch)
tree4f11557bb830061c37826aacb6fa54f8213cd609 /source/blender/python/mathutils/mathutils_Color.c
parent785373b03abd7bfd258a50a0f274c81229fbf98a (diff)
patch to add __deepcopy__ to mathutils types, this is no different to __copy__, except some py utilities expect __deepcopy__ to exist, so better have them.
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Color.c')
-rw-r--r--source/blender/python/mathutils/mathutils_Color.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c
index 3b60d6655d6..9b06214b8ec 100644
--- a/source/blender/python/mathutils/mathutils_Color.c
+++ b/source/blender/python/mathutils/mathutils_Color.c
@@ -107,6 +107,12 @@ static PyObject *Color_copy(ColorObject *self)
return Color_CreatePyObject(self->col, Py_NEW, Py_TYPE(self));
}
+static PyObject *Color_deepcopy(ColorObject *self, PyObject *args)
+{
+ if (!mathutils_deepcopy_args_check(args))
+ return NULL;
+ return Color_copy(self);
+}
//----------------------------print object (internal)--------------
//print the object to screen
@@ -789,8 +795,9 @@ static PyGetSetDef Color_getseters[] = {
//-----------------------METHOD DEFINITIONS ----------------------
static struct PyMethodDef Color_methods[] = {
- {"__copy__", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc},
{"copy", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc},
+ {"__copy__", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc},
+ {"__deepcopy__", (PyCFunction) Color_deepcopy, METH_VARARGS, Color_copy_doc},
{NULL, NULL, 0, NULL}
};