diff options
Diffstat (limited to 'source/blender/python/generic/py_capi_utils.c')
-rw-r--r-- | source/blender/python/generic/py_capi_utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index c7ce264f2f9..351ba884d49 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -282,6 +282,17 @@ int PyC_ParseStringEnum(PyObject *o, void *p) return 0; } +const char *PyC_StringEnum_FindIDFromValue(const struct PyC_StringEnumItems *items, + const int value) +{ + for (int i = 0; items[i].id; i++) { + if (items[i].value == value) { + return items[i].id; + } + } + return NULL; +} + /* silly function, we dont use arg. just check its compatible with __deepcopy__ */ int PyC_CheckArgs_DeepCopy(PyObject *args) { |