diff options
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_types.c')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index bb3da095847..812e958dea3 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -2309,6 +2309,7 @@ void BPy_BM_init_types(void) /* only 1 iteratir so far */ BPy_BMIter_Type.tp_iternext = (iternextfunc)bpy_bmiter_next; + BPy_BMIter_Type.tp_iter = PyObject_SelfIter; BPy_BMesh_Type.tp_dealloc = (destructor)bpy_bmesh_dealloc; BPy_BMVert_Type.tp_dealloc = (destructor)bpy_bmvert_dealloc; @@ -2673,3 +2674,15 @@ err_cleanup: return NULL; } } + + +PyObject *BPy_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **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_BMElem_CreatePyObject(bm, elem[i])); + } + + return ret; +} |