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-12-24 04:04:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-24 04:13:58 +0400
commit04a902965e5e226e69c5c6e912dd2f513448d2ac (patch)
treec65a2c9613f5a336f6c2739b5dabc5fbad348230 /source/blender/bmesh/operators/bmo_connect.c
parentd94db03ac8ef9f6a10e42f01d622421fe3f216bb (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/bmesh/operators/bmo_connect.c')
-rw-r--r--source/blender/bmesh/operators/bmo_connect.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c
index d0f64eb2892..3d2c8c3d020 100644
--- a/source/blender/bmesh/operators/bmo_connect.c
+++ b/source/blender/bmesh/operators/bmo_connect.c
@@ -63,7 +63,7 @@ static int bm_face_connect_verts(BMesh *bm, BMFace *f)
continue;
}
- if (l_last != l->prev && l_last != l->next) {
+ if (!BM_loop_is_adjacent(l_last, l)) {
BMLoop **l_pair = STACK_PUSH_RET(loops_split);
l_pair[0] = l_last;
l_pair[1] = l;
@@ -96,7 +96,17 @@ static int bm_face_connect_verts(BMesh *bm, BMFace *f)
}
for (i = 0; i < STACK_SIZE(verts_pair); i++) {
- f_new = BM_face_split(bm, f, verts_pair[i][0], verts_pair[i][1], &l_new, NULL, false);
+ BMLoop *l_a, *l_b;
+
+ if ((l_a = BM_face_vert_share_loop(f, verts_pair[i][0])) &&
+ (l_b = BM_face_vert_share_loop(f, verts_pair[i][1])))
+ {
+ f_new = BM_face_split(bm, f, l_a, l_b, &l_new, NULL, false);
+ }
+ else {
+ f_new = NULL;
+ }
+
f = f_new;
if (!l_new || !f_new) {