diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-11-15 19:22:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-11-17 22:10:53 +0300 |
commit | 46739f1e5ceee43f6e7313dcb4c21829a13789d6 (patch) | |
tree | dbd846b5371e9a9d5592e801d31d9e10992e8f67 /source | |
parent | a1a8343281354d2dfb192e7b9262921ee132a287 (diff) |
BMesh: minor cleanup
Comment & don't use dummy pointer.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.c | 21 |
2 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 0cd91107171..d1178a198dc 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -2682,8 +2682,10 @@ BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep) /** * A version of #bmesh_urmv_loop that disconnects multiple loops at once. + * The loops must all share the same vertex, can be in any order + * and are all moved to use a single new vertex - which is returned. * - * Handles the task of finding fans boundaries. + * This function handles the details of finding fans boundaries. */ BMVert *bmesh_urmv_loop_multi( BMesh *bm, BMLoop **larr, int larr_len) diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 03165beb329..500da6b8788 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -346,7 +346,7 @@ BMFace *BM_face_split_n( BMLoop **r_l, BMEdge *example) { BMFace *f_new, *f_tmp; - BMLoop *l_dummy; + BMLoop *l_new; BMEdge *e, *e_new; BMVert *v_new; // BMVert *v_a = l_a->v; /* UNUSED */ @@ -368,24 +368,21 @@ BMFace *BM_face_split_n( } f_tmp = BM_face_copy(bm, bm, f, true, true); - - if (!r_l) - r_l = &l_dummy; #ifdef USE_BMESH_HOLES - f_new = bmesh_sfme(bm, f, l_a, l_b, r_l, NULL, example, false); + f_new = bmesh_sfme(bm, f, l_a, l_b, &l_new, NULL, example, false); #else - f_new = bmesh_sfme(bm, f, l_a, l_b, r_l, example, false); + f_new = bmesh_sfme(bm, f, l_a, l_b, &l_new, example, false); #endif - /* bmesh_sfme returns in r_l a Loop for f_new going from v_a to v_b. - * The radial_next is for f and goes from v_b to v_a */ + /* bmesh_sfme returns in 'l_new' a Loop for f_new going from 'v_a' to 'v_b'. + * The radial_next is for 'f' and goes from 'v_b' to 'v_a' */ if (f_new) { - e = (*r_l)->e; + e = l_new->e; for (i = 0; i < n; i++) { v_new = bmesh_semv(bm, v_b, e, &e_new); BLI_assert(v_new != NULL); - /* bmesh_semv returns in e_new the edge going from v_new to tv */ + /* bmesh_semv returns in 'e_new' the edge going from 'v_new' to 'v_b' */ copy_v3_v3(v_new->co, cos[i]); /* interpolate the loop data for the loops with (v == v_new), using orig face */ @@ -405,6 +402,10 @@ BMFace *BM_face_split_n( BM_face_verts_kill(bm, f_tmp); + if (r_l) { + *r_l = l_new; + } + return f_new; } |