Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/mathutils/mathutils.c')
-rw-r--r--source/blender/python/mathutils/mathutils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index be7dae6871b..0043fc36162 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -599,6 +599,15 @@ uchar Mathutils_RegisterCallback(Mathutils_Callback *cb)
return i;
}
+int _BaseMathObject_CheckCallback(BaseMathObject *self)
+{
+ Mathutils_Callback *cb = mathutils_callbacks[self->cb_type];
+ if (LIKELY(cb->check(self) != -1)) {
+ return 0;
+ }
+ return -1;
+}
+
/* use macros to check for NULL */
int _BaseMathObject_ReadCallback(BaseMathObject *self)
{
@@ -687,6 +696,13 @@ PyObject *BaseMathObject_is_frozen_get(BaseMathObject *self, void *UNUSED(closur
return PyBool_FromLong((self->flag & BASE_MATH_FLAG_IS_FROZEN) != 0);
}
+char BaseMathObject_is_valid_doc[] =
+ "True when the owner of this data is valid.\n\n:type: boolean";
+PyObject *BaseMathObject_is_valid_get(BaseMathObject *self, void *UNUSED(closure))
+{
+ return PyBool_FromLong(BaseMath_CheckCallback(self) == 0);
+}
+
char BaseMathObject_freeze_doc[] =
".. function:: freeze()\n"
"\n"