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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-16 20:38:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-16 20:38:18 +0400
commit3be732f3ef7a8581a5c7dee01436350a1c203d53 (patch)
treeff507208064b8a226cbc12c16e34065aa48e3c45 /source
parent8a4a034325b856c56de992e58ed1aef287961e73 (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.c10
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);