diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-16 20:38:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-16 20:38:18 +0400 |
commit | 3be732f3ef7a8581a5c7dee01436350a1c203d53 (patch) | |
tree | ff507208064b8a226cbc12c16e34065aa48e3c45 /source | |
parent | 8a4a034325b856c56de992e58ed1aef287961e73 (diff) |
don't create empty mesh object when separating if nothing is selected.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 148c6c413d0..e82176b058d 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3394,6 +3394,16 @@ static int edbm_separate_exec(bContext *C, wmOperator *op) Base *base = CTX_data_active_base(C); BMEditMesh *em = BMEdit_FromObject(base->object); + if (type == 0) { + if ((em->bm->totvertsel == 0) && + (em->bm->totedgesel == 0) && + (em->bm->totfacesel == 0)) + { + BKE_report(op->reports, RPT_ERROR, "Nothing selected"); + return OPERATOR_CANCELLED; + } + } + /* editmode separate */ if (type == 0) retval = mesh_separate_selected(bmain, scene, base, em->bm); else if (type == 1) retval = mesh_separate_material(bmain, scene, base, em->bm); |