forked from bartvdbraak/blender
Fix boolean modifier crash; if boolean code cannot do the operation on the
meshes, print an error dialog and delete the modifier object.
This commit is contained in:
parent
71991cf41e
commit
9b419bb4be
@ -1210,9 +1210,15 @@ static void *booleanModifier_applyModifier(ModifierData *md, Object *ob, void *d
|
||||
if( ((Mesh *)ob->data)->totface>3 && bmd->object && ((Mesh *)bmd->object->data)->totface>3) {
|
||||
DispListMesh *dlm= NewBooleanMeshDLM(bmd->object, ob, 1+bmd->operation);
|
||||
|
||||
/* if new mesh returned, get derived mesh; otherwise there was
|
||||
* an error, so delete the modifier object */
|
||||
|
||||
if( dlm )
|
||||
return derivedmesh_from_displistmesh(dlm, NULL);
|
||||
else
|
||||
bmd->object = NULL;
|
||||
}
|
||||
else return derivedData;
|
||||
return derivedData;
|
||||
}
|
||||
|
||||
/***/
|
||||
|
@ -499,7 +499,9 @@ DispListMesh *NewBooleanMeshDLM(Object *ob, Object *ob_select, int int_op_type)
|
||||
);
|
||||
}
|
||||
|
||||
if (success) {
|
||||
switch( success ) {
|
||||
case 1:
|
||||
{
|
||||
// descriptions of the output;
|
||||
CSG_VertexIteratorDescriptor vd_o;
|
||||
CSG_FaceIteratorDescriptor fd_o;
|
||||
@ -525,10 +527,19 @@ DispListMesh *NewBooleanMeshDLM(Object *ob, Object *ob_select, int int_op_type)
|
||||
CSG_FreeVertexDescriptor(&vd_o);
|
||||
CSG_FreeFaceDescriptor(&fd_o);
|
||||
}
|
||||
break;
|
||||
case -1:
|
||||
error("Selected meshes must have faces to perform boolean operations");
|
||||
break;
|
||||
case -2:
|
||||
error("Both meshes must be closed");
|
||||
break;
|
||||
default:
|
||||
error("unknown internal error");
|
||||
break;
|
||||
}
|
||||
|
||||
CSG_FreeBooleanOperation(bool_op);
|
||||
bool_op = NULL;
|
||||
|
||||
}
|
||||
|
||||
// We may need to map back the tfaces to mcols here.
|
||||
|
Loading…
Reference in New Issue
Block a user