diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-29 08:09:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-29 08:13:26 +0300 |
commit | c17c6557b4ea4bfeb4528b74703795798aedaa66 (patch) | |
tree | 04559e5492c946672bd45272e216be9c9f5cce7e /source/blender/python/mathutils/mathutils_Matrix.h | |
parent | 26a64ba23a8e5586f2dfb72195a30bcf8acd9c90 (diff) |
PyAPI: add function to check any mathutils type
Also add CheckExact versions of type checking macros.
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Matrix.h')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.h b/source/blender/python/mathutils/mathutils_Matrix.h index 9c84716d307..d2fbe6a04d5 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.h +++ b/source/blender/python/mathutils/mathutils_Matrix.h @@ -30,7 +30,10 @@ extern PyTypeObject matrix_Type; extern PyTypeObject matrix_access_Type; -#define MatrixObject_Check(_v) PyObject_TypeCheck((_v), &matrix_Type) + +#define MatrixObject_Check(v) PyObject_TypeCheck((v), &matrix_Type) +#define MatrixObject_CheckExact(v) (Py_TYPE(v) == &matrix_Type) + #define MATRIX_MAX_DIM 4 /* matrix[row][col] == MATRIX_ITEM_INDEX(matrix, row, col) */ |