diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-24 04:04:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-24 04:13:58 +0400 |
commit | 04a902965e5e226e69c5c6e912dd2f513448d2ac (patch) | |
tree | c65a2c9613f5a336f6c2739b5dabc5fbad348230 /source/blender/python/bmesh | |
parent | d94db03ac8ef9f6a10e42f01d622421fe3f216bb (diff) |
BMesh optimize face splitting by taking loops rather then verts
- add BM_vert_pair_share_face
- add BM_loop_is_adjacent
- remove BM_verts_connect
Diffstat (limited to 'source/blender/python/bmesh')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_utils.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c index d228e1a0646..236d6badd55 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.c +++ b/source/blender/python/bmesh/bmesh_py_utils.c @@ -401,6 +401,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args, BMesh *bm; BMFace *f_new = NULL; BMLoop *l_new = NULL; + BMLoop *l_a, *l_b; if (!PyArg_ParseTupleAndKeywords(args, kw, "O!O!O!|OiO!:face_split", (char **)kwlist, &BPy_BMFace_Type, &py_face, @@ -422,9 +423,12 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args, } /* this doubles for checking that the verts are in the same mesh */ - if (BM_vert_in_face(py_face->f, py_vert_a->v) == false || - BM_vert_in_face(py_face->f, py_vert_b->v) == false) + if ((l_a = BM_face_vert_share_loop(py_face->f, py_vert_a->v)) && + (l_b = BM_face_vert_share_loop(py_face->f, py_vert_b->v))) { + /* pass */ + } + else { PyErr_SetString(PyExc_ValueError, "face_split(...): one of the verts passed is not found in the face"); return NULL; @@ -448,14 +452,14 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args, if (ncoords) { f_new = BM_face_split_n(bm, py_face->f, - py_vert_a->v, py_vert_b->v, + l_a, l_b, (float (*)[3])coords, ncoords, &l_new, py_edge_example ? py_edge_example->e : NULL); PyMem_Free(coords); } else { f_new = BM_face_split(bm, py_face->f, - py_vert_a->v, py_vert_b->v, + l_a, l_b, &l_new, py_edge_example ? py_edge_example->e : NULL, edge_exists); } |