From 49411a6e37ce88e644db733621ac2577851a7b7e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 13 Aug 2013 01:00:07 +0000 Subject: fix own regression, rip tool wasn't handling selection. --- source/blender/editors/mesh/editmesh_rip.c | 32 +++++------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'source/blender/editors/mesh/editmesh_rip.c') diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 1128d705e47..253aef7d5fe 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -50,6 +50,8 @@ #include "ED_transform.h" #include "ED_view3d.h" +#include "tools/bmesh_edgesplit.h" + #include "mesh_intern.h" /* own include */ /** @@ -510,24 +512,6 @@ static void edbm_tagged_loop_pairs_do_fill_faces(BMesh *bm, UnorderedLoopPair *u /* --- end 'face-fill' code --- */ - -static bool edbm_rip_call_edgesplit(BMEditMesh *em, wmOperator *op) -{ - BMOperator bmop; - - if (!EDBM_op_init(em, &bmop, op, "split_edges edges=%he verts=%hv use_verts=%b", - BM_ELEM_TAG, BM_ELEM_SELECT, true)) - { - return false; - } - BMO_op_exec(em->bm, &bmop); - if (!EDBM_op_finish(em, &bmop, op, true)) { - return false; - } - - return true; -} - /** * This is the main vert ripping function (rip when one vertex is selected) */ @@ -648,7 +632,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve BM_vert_select_set(bm, v, false); - bmesh_vert_separate(bm, v, &vout, &vout_len); + bmesh_vert_separate(bm, v, &vout, &vout_len, true); if (vout_len < 2) { MEM_freeN(vout); @@ -784,10 +768,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve fill_uloop_pairs = edbm_tagged_loop_pairs_to_fill(bm); } - if (!edbm_rip_call_edgesplit(em, op)) { - if (fill_uloop_pairs) MEM_freeN(fill_uloop_pairs); - return OPERATOR_CANCELLED; - } + BM_mesh_edgesplit(em->bm, true, true, true); } dist = FLT_MAX; @@ -949,10 +930,7 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve fill_uloop_pairs = edbm_tagged_loop_pairs_to_fill(bm); } - if (!edbm_rip_call_edgesplit(em, op)) { - if (fill_uloop_pairs) MEM_freeN(fill_uloop_pairs); - return OPERATOR_CANCELLED; - } + BM_mesh_edgesplit(em->bm, true, true, true); /* note: the output of the bmesh operator is ignored, since we built * the contiguous loop pairs to split already, its possible that some -- cgit v1.2.3