Merge branch 'master' into blender2.8
This commit is contained in:
@@ -419,13 +419,6 @@ PyObject *mathutils_dynstr_to_py(struct DynStr *ds)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* silly function, we dont use arg. just check its compatible with __deepcopy__ */
|
||||
int mathutils_deepcopy_args_check(PyObject *args)
|
||||
{
|
||||
PyObject *dummy_pydict;
|
||||
return PyArg_ParseTuple(args, "|O!:__deepcopy__", &PyDict_Type, &dummy_pydict) != 0;
|
||||
}
|
||||
|
||||
/* Mathutils Callbacks */
|
||||
|
||||
/* for mathutils internal use only, eventually should re-alloc but to start with we only have a few users */
|
||||
|
@@ -174,6 +174,4 @@ int column_vector_multiplication(float rvec[4], VectorObject *vec, MatrixObject
|
||||
PyObject *mathutils_dynstr_to_py(struct DynStr *ds);
|
||||
#endif
|
||||
|
||||
int mathutils_deepcopy_args_check(PyObject *args);
|
||||
|
||||
#endif /* __MATHUTILS_H__ */
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "../generic/python_utildefines.h"
|
||||
#include "../generic/py_capi_utils.h"
|
||||
|
||||
#ifndef MATH_STANDALONE
|
||||
# include "BLI_dynstr.h"
|
||||
@@ -113,8 +114,9 @@ static PyObject *Color_copy(ColorObject *self)
|
||||
}
|
||||
static PyObject *Color_deepcopy(ColorObject *self, PyObject *args)
|
||||
{
|
||||
if (!mathutils_deepcopy_args_check(args))
|
||||
if (!PyC_CheckArgs_DeepCopy(args)) {
|
||||
return NULL;
|
||||
}
|
||||
return Color_copy(self);
|
||||
}
|
||||
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_utildefines.h"
|
||||
#include "../generic/python_utildefines.h"
|
||||
#include "../generic/py_capi_utils.h"
|
||||
|
||||
#ifndef MATH_STANDALONE
|
||||
# include "BLI_dynstr.h"
|
||||
@@ -312,8 +313,9 @@ static PyObject *Euler_copy(EulerObject *self)
|
||||
}
|
||||
static PyObject *Euler_deepcopy(EulerObject *self, PyObject *args)
|
||||
{
|
||||
if (!mathutils_deepcopy_args_check(args))
|
||||
if (!PyC_CheckArgs_DeepCopy(args)) {
|
||||
return NULL;
|
||||
}
|
||||
return Euler_copy(self);
|
||||
}
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "../generic/python_utildefines.h"
|
||||
#include "../generic/py_capi_utils.h"
|
||||
|
||||
#ifndef MATH_STANDALONE
|
||||
# include "BLI_string.h"
|
||||
@@ -1945,8 +1946,9 @@ static PyObject *Matrix_copy(MatrixObject *self)
|
||||
}
|
||||
static PyObject *Matrix_deepcopy(MatrixObject *self, PyObject *args)
|
||||
{
|
||||
if (!mathutils_deepcopy_args_check(args))
|
||||
if (!PyC_CheckArgs_DeepCopy(args)) {
|
||||
return NULL;
|
||||
}
|
||||
return Matrix_copy(self);
|
||||
}
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "../generic/python_utildefines.h"
|
||||
#include "../generic/py_capi_utils.h"
|
||||
|
||||
#ifndef MATH_STANDALONE
|
||||
# include "BLI_dynstr.h"
|
||||
@@ -496,8 +497,9 @@ static PyObject *Quaternion_copy(QuaternionObject *self)
|
||||
}
|
||||
static PyObject *Quaternion_deepcopy(QuaternionObject *self, PyObject *args)
|
||||
{
|
||||
if (!mathutils_deepcopy_args_check(args))
|
||||
if (!PyC_CheckArgs_DeepCopy(args)) {
|
||||
return NULL;
|
||||
}
|
||||
return Quaternion_copy(self);
|
||||
}
|
||||
|
||||
@@ -1393,4 +1395,3 @@ PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user,
|
||||
|
||||
return (PyObject *)self;
|
||||
}
|
||||
|
||||
|
@@ -1331,8 +1331,9 @@ static PyObject *Vector_copy(VectorObject *self)
|
||||
}
|
||||
static PyObject *Vector_deepcopy(VectorObject *self, PyObject *args)
|
||||
{
|
||||
if (!mathutils_deepcopy_args_check(args))
|
||||
if (!PyC_CheckArgs_DeepCopy(args)) {
|
||||
return NULL;
|
||||
}
|
||||
return Vector_copy(self);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user