diff options
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_types.c')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index c2b496f914b..dc2792e6e42 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -3669,7 +3669,6 @@ err_cleanup: } } - PyObject *BPy_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **elem, Py_ssize_t elem_len) { Py_ssize_t i; @@ -3677,6 +3676,44 @@ PyObject *BPy_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **elem, Py_ssize_t elem_ for (i = 0; i < elem_len; i++) { PyTuple_SET_ITEM(ret, i, BPy_BMElem_CreatePyObject(bm, elem[i])); } + return ret; +} +PyObject *BPy_BMVert_Array_As_Tuple(BMesh *bm, BMVert **elem, Py_ssize_t elem_len) +{ + Py_ssize_t i; + PyObject *ret = PyTuple_New(elem_len); + for (i = 0; i < elem_len; i++) { + PyTuple_SET_ITEM(ret, i, BPy_BMVert_CreatePyObject(bm, elem[i])); + } + return ret; +} +PyObject *BPy_BMEdge_Array_As_Tuple(BMesh *bm, BMEdge **elem, Py_ssize_t elem_len) +{ + Py_ssize_t i; + PyObject *ret = PyTuple_New(elem_len); + for (i = 0; i < elem_len; i++) { + PyTuple_SET_ITEM(ret, i, BPy_BMEdge_CreatePyObject(bm, elem[i])); + } + + return ret; +} +PyObject *BPy_BMFace_Array_As_Tuple(BMesh *bm, BMFace **elem, Py_ssize_t elem_len) +{ + Py_ssize_t i; + PyObject *ret = PyTuple_New(elem_len); + for (i = 0; i < elem_len; i++) { + PyTuple_SET_ITEM(ret, i, BPy_BMFace_CreatePyObject(bm, elem[i])); + } + + return ret; +} +PyObject *BPy_BMLoop_Array_As_Tuple(BMesh *bm, BMLoop **elem, Py_ssize_t elem_len) +{ + Py_ssize_t i; + PyObject *ret = PyTuple_New(elem_len); + for (i = 0; i < elem_len; i++) { + PyTuple_SET_ITEM(ret, i, BPy_BMLoop_CreatePyObject(bm, elem[i])); + } return ret; } |