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.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.h')
-rw-r--r-- | source/blender/python/mathutils/mathutils.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils.h b/source/blender/python/mathutils/mathutils.h index d1fb6dcdb82..ec927a9e316 100644 --- a/source/blender/python/mathutils/mathutils.h +++ b/source/blender/python/mathutils/mathutils.h @@ -78,6 +78,10 @@ typedef struct { #include "mathutils_Euler.h" #include "mathutils_Color.h" +/* avoid checking all types */ +#define BaseMathObject_CheckExact(v) \ + (Py_TYPE(v)->tp_dealloc == (destructor)BaseMathObject_dealloc) + PyObject *BaseMathObject_owner_get(BaseMathObject *self, void *); PyObject *BaseMathObject_is_wrapped_get(BaseMathObject *self, void *); PyObject *BaseMathObject_is_frozen_get(BaseMathObject *self, void *); |