diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-09-03 14:18:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-09-03 14:21:44 +0300 |
commit | 0950cfd9d53ef666cf820765e83586f72b04e9b6 (patch) | |
tree | 1426c078d128770f493a1444fa16f07cd6d41c4b /source/blender/python/mathutils/mathutils_Vector.c | |
parent | f530b435501b36ea5621eacbd2624db11864b8c3 (diff) |
PyAPI: add read-only 'is_valid' attribute to mathutils types
There was no convenient way to check if the owner
of a mathutils type was valid.
Added to support issue reported in T91111.
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Vector.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Vector.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index efcaa9b6a51..23758c5603e 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -2551,6 +2551,11 @@ static PyGetSetDef Vector_getseters[] = { (setter)NULL, BaseMathObject_is_frozen_doc, NULL}, + {"is_valid", + (getter)BaseMathObject_is_valid_get, + (setter)NULL, + BaseMathObject_is_valid_doc, + NULL}, {"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL}, /* Auto-generated swizzle attributes, see Python script above. */ |