From 89b83f00608dfb2a7750476035f0635885473d21 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Mar 2012 11:35:58 +0000 Subject: 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. --- source/blender/python/mathutils/mathutils_Euler.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/python/mathutils/mathutils_Euler.c') diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index ecd0cee03b5..4e3b5f8d52e 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -299,6 +299,12 @@ static PyObject *Euler_copy(EulerObject *self) return Euler_CreatePyObject(self->eul, self->order, Py_NEW, Py_TYPE(self)); } +static PyObject *Euler_deepcopy(EulerObject *self, PyObject *args) +{ + if (!mathutils_deepcopy_args_check(args)) + return NULL; + return Euler_copy(self); +} //----------------------------print object (internal)-------------- //print the object to screen @@ -632,8 +638,9 @@ static struct PyMethodDef Euler_methods[] = { {"rotate_axis", (PyCFunction) Euler_rotate_axis, METH_VARARGS, Euler_rotate_axis_doc}, {"rotate", (PyCFunction) Euler_rotate, METH_O, Euler_rotate_doc}, {"make_compatible", (PyCFunction) Euler_make_compatible, METH_O, Euler_make_compatible_doc}, - {"__copy__", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc}, {"copy", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc}, + {"__copy__", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc}, + {"__deepcopy__", (PyCFunction) Euler_deepcopy, METH_VARARGS, Euler_copy_doc}, {NULL, NULL, 0, NULL} }; -- cgit v1.2.3