diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-13 05:00:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-13 05:00:07 +0400 |
commit | 49411a6e37ce88e644db733621ac2577851a7b7e (patch) | |
tree | 1c8b40d96f40d1e991694ce227d6e7572b620422 /source/blender/bmesh/intern | |
parent | fd14c344e0b1160ab17243297a86521d73256b8b (diff) |
fix own regression, rip tool wasn't handling selection.
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 23 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.h | 6 |
2 files changed, 20 insertions, 9 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 51461190233..b296c367575 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -1915,7 +1915,8 @@ bool BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target) * * \return Success */ -void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len) +void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len, + const bool copy_select) { const int v_edgetot = BM_vert_face_count(v); BMEdge **stack = BLI_array_alloca(stack, v_edgetot); @@ -1970,6 +1971,9 @@ void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len verts[0] = v; for (i = 1; i < maxindex; i++) { verts[i] = BM_vert_create(bm, v->co, v, 0); + if (copy_select) { + BM_elem_select_copy(bm, bm, verts[i], v); + } } /* Replace v with the new verts in each group */ @@ -2052,11 +2056,11 @@ void BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len, for (i = 0; i < e_in_len; i++) { BMEdge *e = e_in[i]; if (e->l && BM_vert_in_edge(e, v)) { - bmesh_edge_separate(bm, e, e->l); + bmesh_edge_separate(bm, e, e->l, false); } } - bmesh_vert_separate(bm, v, r_vout, r_vout_len); + bmesh_vert_separate(bm, v, r_vout, r_vout_len, false); } /** @@ -2112,7 +2116,8 @@ bool BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target) * \note Does nothing if \a l_sep is already the only loop in the * edge radial. */ -void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep) +void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep, + const bool copy_select) { BMEdge *e_new; #ifndef NDEBUG @@ -2136,6 +2141,10 @@ void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep) bmesh_radial_append(e_new, l_sep); l_sep->e = e_new; + if (copy_select) { + BM_elem_select_copy(bm, bm, e_new, e); + } + BLI_assert(bmesh_radial_length(e->l) == radlen - 1); BLI_assert(bmesh_radial_length(e_new->l) == 1); @@ -2159,8 +2168,8 @@ BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep) /* peel the face from the edge radials on both sides of the * loop vert, disconnecting the face from its fan */ - bmesh_edge_separate(bm, l_sep->e, l_sep); - bmesh_edge_separate(bm, l_sep->prev->e, l_sep->prev); + bmesh_edge_separate(bm, l_sep->e, l_sep, false); + bmesh_edge_separate(bm, l_sep->prev->e, l_sep->prev, false); if (bmesh_disk_count(v_sep) == 2) { /* If there are still only two edges out of v_sep, then @@ -2178,7 +2187,7 @@ BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep) /* Split all fans connected to the vert, duplicating it for * each fans. */ - bmesh_vert_separate(bm, v_sep, &vtar, &len); + bmesh_vert_separate(bm, v_sep, &vtar, &len, false); /* There should have been at least two fans cut apart here, * otherwise the early exit would have kicked in. */ diff --git a/source/blender/bmesh/intern/bmesh_core.h b/source/blender/bmesh/intern/bmesh_core.h index ea25a5c3ee7..c9e806335dd 100644 --- a/source/blender/bmesh/intern/bmesh_core.h +++ b/source/blender/bmesh/intern/bmesh_core.h @@ -50,11 +50,13 @@ void BM_face_kill(BMesh *bm, BMFace *f); void BM_edge_kill(BMesh *bm, BMEdge *e); void BM_vert_kill(BMesh *bm, BMVert *v); -void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep); +void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep, + const bool copy_select); bool BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target); bool BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target); -void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len); +void bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len, + const bool copy_select); bool bmesh_loop_reverse(BMesh *bm, BMFace *f); |