diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-08 06:14:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-08 06:14:58 +0400 |
commit | 45669ebbc6fab86e1576378b75298116009a2318 (patch) | |
tree | 1f96edbf5b1784d83814d700e45a738dadef51f7 /source/blender/editors/mesh/editmesh_inset.c | |
parent | 68239cb098837762f41889f6a8069c564cabb576 (diff) |
inset and bevel could both be activated when there was no selection.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_inset.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_inset.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index 7a879d398f1..b54797337f4 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -113,6 +113,10 @@ static int edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal) Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = BMEdit_FromObject(obedit); + if (em->bm->totvertsel == 0) { + return 0; + } + op->customdata = opdata = MEM_mallocN(sizeof(InsetData), "inset_operator_data"); opdata->old_thickness = 0.01; @@ -239,7 +243,9 @@ static int edbm_inset_calc(wmOperator *op) static int edbm_inset_exec(bContext *C, wmOperator *op) { - edbm_inset_init(C, op, false); + if (!edbm_inset_init(C, op, false)) { + return OPERATOR_CANCELLED; + } if (!edbm_inset_calc(op)) { edbm_inset_exit(C, op); @@ -257,7 +263,9 @@ static int edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event) float mlen[2]; float center_3d[3]; - edbm_inset_init(C, op, true); + if (!edbm_inset_init(C, op, true)) { + return OPERATOR_CANCELLED; + } opdata = op->customdata; |