From 1c3a1ba3612c47a68aa4fbb56d5d487cf90310f6 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 9 Apr 2004 07:42:43 +0000 Subject: [PATCH] Tell the user he is trying to do a boolean op with a faceless mesh, instead of spewing a meaningless "An internal error occurred -- sorry" message. --- source/blender/src/booleanops.c | 4 ++-- source/blender/src/editobject.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c index 6edcf206870..0ced994fd56 100644 --- a/source/blender/src/booleanops.c +++ b/source/blender/src/booleanops.c @@ -412,9 +412,9 @@ NewBooleanMesh( if (me == NULL || me2 == NULL) return 0; success = has_faces(me); - if(success==0) return 0; + if(success==0) return -1; success = has_faces(me2); - if(success==0) return 0; + if(success==0) return -1; success = 0; diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 5a9227fe61b..360c71c8a39 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -1458,7 +1458,7 @@ void special_editmenu(void) extern short editbutflag; extern float doublimit; float fac; - int nr; + int nr,ret; short randfac; if(G.obedit==0) { @@ -1547,10 +1547,12 @@ void special_editmenu(void) if (base_select) { if (get_mesh(base_select->object)) { waitcursor(1); - - if (!NewBooleanMesh(BASACT,base_select,nr)) { + ret = NewBooleanMesh(BASACT,base_select,nr); + if (ret==0) { error("An internal error occurred -- sorry!"); - } + } else if(ret==-1) { + error("Boolean ops with faceless meshes is not allowed"); + } waitcursor(0); } else {