diff options
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Vector.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Vector.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index fbf30bcb387..17fa9cdd802 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -47,6 +47,7 @@ #define SWIZZLE_AXIS 0x3 static PyObject *Vector_copy(VectorObject *self); +static PyObject *Vector_deepcopy(VectorObject *self, PyObject *args); static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits); static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat); @@ -1211,6 +1212,12 @@ static PyObject *Vector_copy(VectorObject *self) return Vector_CreatePyObject(self->vec, self->size, Py_NEW, Py_TYPE(self)); } +static PyObject *Vector_deepcopy(VectorObject *self, PyObject *args) +{ + if (!mathutils_deepcopy_args_check(args)) + return NULL; + return Vector_copy(self); +} static PyObject *Vector_repr(VectorObject *self) { @@ -2767,6 +2774,7 @@ static struct PyMethodDef Vector_methods[] = { {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, NULL}, + {"__deepcopy__", (PyCFunction) Vector_deepcopy, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; |