diff options
author | Daniel Dunbar <daniel@zuster.org> | 2003-03-24 19:08:15 +0300 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2003-03-24 19:08:15 +0300 |
commit | f7cc1873b7afef134492b5344ceb7724bdfe4180 (patch) | |
tree | 5e696a7ab5f32127048467dcb0f1c9d7a83f5450 /source/blender | |
parent | b224f90da7396e8430e0f24fb30ead31ef294cd8 (diff) |
Fix for bug #72.
Update mesh normals after a boolean operation.
Also updated boolen operation to copy face flag (propagate
face smoothness information).
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_booleanops.h | 2 | ||||
-rw-r--r-- | source/blender/src/booleanops.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_booleanops.h b/source/blender/blenkernel/BKE_booleanops.h index 3f0e3dde4ac..c3dcb320b5b 100644 --- a/source/blender/blenkernel/BKE_booleanops.h +++ b/source/blender/blenkernel/BKE_booleanops.h @@ -132,7 +132,7 @@ typedef struct { /* assorted tface flags */ void *tpage; - char flag, transp; + char flag, transp, faceflag; short mode, tile; } FaceData; diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c index 1ba293ba872..683911950ee 100644 --- a/source/blender/src/booleanops.c +++ b/source/blender/src/booleanops.c @@ -244,6 +244,7 @@ FaceIt_Fill( } } + fdata->faceflag = mface->flag; fdata->material = give_current_material(ob, mface->mat_nr+1); // pack rgba colors. @@ -605,8 +606,6 @@ AddNewBlenderMesh( return ob_new; }; - - /** * * External interface @@ -702,6 +701,7 @@ ConvertCSGDescriptorsToMeshObject( FaceData *fdata; face_it->Fill(face_it->it,&face); + fdata = face.user_face_data; // cheat CSG never dumps out quads. @@ -713,13 +713,12 @@ ConvertCSGDescriptorsToMeshObject( mface->edcode = ME_V1V2|ME_V2V3|ME_V3V4|ME_V4V1; mface->puno = 0; mface->mat_nr = 0; - mface->flag = 0; + mface->flag = fdata->faceflag; /* HACK, perform material to index mapping using a general * hash table, just tuck the int into a void *. */ - fdata = face.user_face_data; if (!BLI_ghash_haskey(material_hash, fdata->material)) { int matnr = nmaterials++; BLI_ghash_insert(material_hash, fdata->material, (void*) matnr); @@ -765,8 +764,10 @@ ConvertCSGDescriptorsToMeshObject( BLI_ghash_free(material_hash, NULL, NULL); me->totface = face_it->num_elements; - // thats it! + mesh_calculate_vertex_normals(me); + + // thats it! if (user_face_vertex_data) { MEM_freeN(user_face_vertex_data); } |