diff options
-rw-r--r-- | source/blender/editors/mesh/editmesh_rip.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 84e9b0658ed..2380efc818b 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -372,6 +372,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) BMLoop *l; BMEdge *e, *e2; BMVert *v, *ripvert = NULL; + const int totvert_orig = bm->totvert; int i; float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]}; float dist = FLT_MAX; @@ -573,6 +574,11 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) } } + if (totvert_orig == bm->totvert) { + BKE_report(op->reports, RPT_ERROR, "No vertices could be ripped"); + return OPERATOR_CANCELLED; + } + return OPERATOR_FINISHED; } @@ -590,6 +596,7 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, wmEvent *event) BMLoop *l; BMEdge *e, *e2; BMVert *v; + const int totedge_orig = bm->totedge; int i; float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]}; @@ -671,6 +678,12 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, wmEvent *event) ar, projectMat, fmval); MEM_freeN(eloop_pairs); + if (totedge_orig == bm->totedge) { + BKE_report(op->reports, RPT_ERROR, "No edges could be ripped"); + return OPERATOR_CANCELLED; + } + + EDBM_selectmode_flush(em); return OPERATOR_FINISHED; } @@ -684,7 +697,6 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) BMIter iter; BMEdge *e; int singlesel = (bm->totvertsel == 1 && bm->totedgesel == 0 && bm->totfacesel == 0); - const int totedge_orig = bm->totedge; int ret; /* running in face mode hardly makes sense, so convert to region loop and rip */ @@ -724,13 +736,6 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_CANCELLED; } - EDBM_selectmode_flush(em); - - if ((singlesel == FALSE) && (totedge_orig == bm->totedge)) { - BKE_report(op->reports, RPT_ERROR, "No edges could be ripped"); - return OPERATOR_CANCELLED; - } - BLI_assert(singlesel ? (bm->totvertsel > 0) : (bm->totedgesel > 0)); if (bm->totvertsel == 0) { |