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