diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-26 02:44:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-26 02:44:08 +0400 |
commit | 84334bde01dd2ed7913cbddeea966b2f0364a2b9 (patch) | |
tree | c22cd0076c2633dbb4f6811eeaf8b1855aa09c73 /source/blender/editors/mesh/editmesh_bisect.c | |
parent | 02f90c000115d5d2ab330005e20d02419defe35a (diff) |
Fix 37571: Knife Select should be disabled when no faces are selected
also check a similar case for bisect
Diffstat (limited to 'source/blender/editors/mesh/editmesh_bisect.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_bisect.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c index 7bc3ff3ab77..c3c4bda4178 100644 --- a/source/blender/editors/mesh/editmesh_bisect.c +++ b/source/blender/editors/mesh/editmesh_bisect.c @@ -36,6 +36,7 @@ #include "BKE_global.h" #include "BKE_context.h" #include "BKE_editmesh.h" +#include "BKE_report.h" #include "RNA_define.h" #include "RNA_access.h" @@ -110,8 +111,15 @@ static bool mesh_bisect_interactive_calc( static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event) { + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BKE_editmesh_from_object(obedit); int ret; + if (em->bm->totedgesel == 0) { + BKE_report(op->reports, RPT_ERROR, "Selected edges/faces required"); + return OPERATOR_CANCELLED; + } + /* if the properties are set or there is no rv3d, * skip model and exec immediately */ @@ -129,8 +137,6 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event) wmGesture *gesture = op->customdata; BisectData *opdata; - Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = BKE_editmesh_from_object(obedit); opdata = MEM_mallocN(sizeof(BisectData), "inset_operator_data"); opdata->mesh_backup = EDBM_redo_state_store(em); |