Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-08 16:59:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-08 16:59:46 +0400
commitc6702a3b917894bf150e19526e1eedd8d5f2e91b (patch)
tree6f40add1f971a8b0a561ed8cdbe1f6717a77405c /source/blender/python
parentf74201190dfe64b29f2b5f270ac2b3543066834d (diff)
use BM_face_create_ngon_verts for python api face creation
(avoid doing it inline).
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 23837404b31..2a0964cefbd 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -1974,10 +1974,8 @@ static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
else {
BMesh *bm = self->bm;
Py_ssize_t vert_seq_len;
- Py_ssize_t i, i_next;
BMVert **vert_array = NULL;
- BMEdge **edge_array = NULL;
PyObject *ret = NULL;
@@ -2005,14 +2003,7 @@ static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
/* Go ahead and make the face!
* --------------------------- */
- edge_array = (BMEdge **)PyMem_MALLOC(vert_seq_len * sizeof(BMEdge **));
-
- /* ensure edges */
- for (i = vert_seq_len - 1, i_next = 0; i_next < vert_seq_len; (i = i_next++)) {
- edge_array[i] = BM_edge_create(bm, vert_array[i], vert_array[i_next], NULL, BM_CREATE_NO_DOUBLE);
- }
-
- f_new = BM_face_create(bm, vert_array, edge_array, vert_seq_len, 0);
+ f_new = BM_face_create_ngon_verts(bm, vert_array, vert_seq_len, 0, false, true);
if (UNLIKELY(f_new == NULL)) {
PyErr_SetString(PyExc_ValueError,
@@ -2029,7 +2020,6 @@ static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
/* pass through */
cleanup:
if (vert_array) PyMem_FREE(vert_array);
- if (edge_array) PyMem_FREE(edge_array);
return ret;
}
}