From 4a5933bb74c4658c5ae35bafa4f0f6145a0430a5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 May 2015 05:34:07 +1000 Subject: Rip tool, support filling-edges with fill enabled --- source/blender/editors/mesh/editmesh_rip.c | 31 ++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 44c0f83cb9f..c7a7828f3b2 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -607,6 +607,11 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve if (ese.ele) { BM_select_history_store(bm, v_new); } + + if (do_fill) { + BM_edge_create(bm, v, v_new, NULL, BM_CREATE_NOP); + } + return OPERATOR_FINISHED; } @@ -719,6 +724,15 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve } } + /* vout[0] == best + * vout[1] == glue + * vout[2+] == splice with glue (when vout_len > 2) + */ + if (vi_best != 0) { + SWAP(BMVert *, vout[0], vout[vi_best]); + vi_best = 0; + } + /* select the vert from the best region */ v = vout[vi_best]; BM_vert_select_set(bm, v, true); @@ -729,21 +743,18 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve /* splice all others back together */ if (vout_len > 2) { - - /* vout[0] == best - * vout[1] == glue - * vout[2+] == splice with glue - */ - if (vi_best != 0) { - SWAP(BMVert *, vout[0], vout[vi_best]); - vi_best = 0; - } - for (i = 2; i < vout_len; i++) { BM_vert_splice(bm, vout[1], vout[i]); } } + if (do_fill) { + if (do_fill) { + /* match extrude vert-order */ + BM_edge_create(bm, vout[1], vout[0], NULL, BM_CREATE_NOP); + } + } + MEM_freeN(vout); return OPERATOR_FINISHED; -- cgit v1.2.3