Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-08 06:14:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-08 06:14:58 +0400
commit45669ebbc6fab86e1576378b75298116009a2318 (patch)
tree1f96edbf5b1784d83814d700e45a738dadef51f7
parent68239cb098837762f41889f6a8069c564cabb576 (diff)
inset and bevel could both be activated when there was no selection.
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c2
-rw-r--r--source/blender/editors/mesh/editmesh_inset.c12
2 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index fb2c7812c12..d061f5fbcc8 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -97,7 +97,7 @@ static int edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
BMEditMesh *em = BMEdit_FromObject(obedit);
BevelData *opdata;
- if (em == NULL) {
+ if (em->bm->totvertsel == 0) {
return 0;
}
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;