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.

This commit is contained in:
Nathan Letwory
2004-04-09 07:42:43 +00:00
parent 0e9e6bdc72
commit 1c3a1ba361
2 changed files with 8 additions and 6 deletions

View File

@@ -412,9 +412,9 @@ NewBooleanMesh(
if (me == NULL || me2 == NULL) return 0; if (me == NULL || me2 == NULL) return 0;
success = has_faces(me); success = has_faces(me);
if(success==0) return 0; if(success==0) return -1;
success = has_faces(me2); success = has_faces(me2);
if(success==0) return 0; if(success==0) return -1;
success = 0; success = 0;

View File

@@ -1458,7 +1458,7 @@ void special_editmenu(void)
extern short editbutflag; extern short editbutflag;
extern float doublimit; extern float doublimit;
float fac; float fac;
int nr; int nr,ret;
short randfac; short randfac;
if(G.obedit==0) { if(G.obedit==0) {
@@ -1547,10 +1547,12 @@ void special_editmenu(void)
if (base_select) { if (base_select) {
if (get_mesh(base_select->object)) { if (get_mesh(base_select->object)) {
waitcursor(1); waitcursor(1);
ret = NewBooleanMesh(BASACT,base_select,nr);
if (!NewBooleanMesh(BASACT,base_select,nr)) { if (ret==0) {
error("An internal error occurred -- sorry!"); error("An internal error occurred -- sorry!");
} } else if(ret==-1) {
error("Boolean ops with faceless meshes is not allowed");
}
waitcursor(0); waitcursor(0);
} else { } else {