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
diff options
context:
space:
mode:
authorKen Hughes <khughes@pacific.edu>2006-01-01 18:41:20 +0300
committerKen Hughes <khughes@pacific.edu>2006-01-01 18:41:20 +0300
commit9b419bb4be7835df3afc30855808961b637da614 (patch)
treebb4457057dc74c4c1b0cd2a50d00e7847063ec99 /source/blender/src/booleanops.c
parent71991cf41ed5018ffaf3f00b75fd142419b36af0 (diff)
Fix boolean modifier crash; if boolean code cannot do the operation on the
meshes, print an error dialog and delete the modifier object.
Diffstat (limited to 'source/blender/src/booleanops.c')
-rw-r--r--source/blender/src/booleanops.c57
1 files changed, 34 insertions, 23 deletions
diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c
index 1b1d5705ab9..17850d08aaa 100644
--- a/source/blender/src/booleanops.c
+++ b/source/blender/src/booleanops.c
@@ -498,37 +498,48 @@ DispListMesh *NewBooleanMeshDLM(Object *ob, Object *ob_select, int int_op_type)
InterpFaceVertexData
);
}
-
- if (success) {
- // descriptions of the output;
- CSG_VertexIteratorDescriptor vd_o;
- CSG_FaceIteratorDescriptor fd_o;
-
- dlm = MEM_callocN(sizeof(*dlm),"dlm");
- CSG_OutputFaceDescriptor(bool_op,&fd_o);
- CSG_OutputVertexDescriptor(bool_op,&vd_o);
+ switch( success ) {
+ case 1:
+ {
+ // descriptions of the output;
+ CSG_VertexIteratorDescriptor vd_o;
+ CSG_FaceIteratorDescriptor fd_o;
+
+ dlm = MEM_callocN(sizeof(*dlm),"dlm");
- // iterate through results of operation and insert into new object
+ CSG_OutputFaceDescriptor(bool_op,&fd_o);
+ CSG_OutputVertexDescriptor(bool_op,&vd_o);
- ConvertCSGDescriptorsToDLM(
- dlm,
- NULL,
- &output_mpd,
- &fd_o,
- &vd_o,
- inv_mat
- );
+ // iterate through results of operation and insert into new object
- // free up the memory
+ ConvertCSGDescriptorsToDLM(
+ dlm,
+ NULL,
+ &output_mpd,
+ &fd_o,
+ &vd_o,
+ inv_mat
+ );
- CSG_FreeVertexDescriptor(&vd_o);
- CSG_FreeFaceDescriptor(&fd_o);
+ // free up the memory
+
+ 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.