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:
authorCampbell Barton <ideasman42@gmail.com>2012-03-20 04:51:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-20 04:51:37 +0400
commitcdfffafd209e1b6178a6cd94372e892f7cf0653a (patch)
tree7b1671cfeb3270bacdfa20d0b42feb1a5ae724c1 /source/blender/modifiers/intern/MOD_boolean_util.c
parent7ba8c9e3bf6e3f81b561d61109bab6830534513b (diff)
partial fix for bug where booleans were using invalid face/poly normals.
the problem remains (though not quite as bad) but think this is because of a bug elsewhere.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_boolean_util.c')
-rw-r--r--source/blender/modifiers/intern/MOD_boolean_util.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c
index 3fd4119c915..04a2caf0cf8 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.c
+++ b/source/blender/modifiers/intern/MOD_boolean_util.c
@@ -354,9 +354,9 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
// create a new DerivedMesh
result = CDDM_new(vertex_it->num_elements, 0, face_it->num_elements, 0, 0);
- CustomData_merge(&dm1->faceData, &result->faceData, CD_MASK_DERIVEDMESH,
+ CustomData_merge(&dm1->faceData, &result->faceData, CD_MASK_DERIVEDMESH & ~CD_MASK_NORMAL,
CD_DEFAULT, face_it->num_elements);
- CustomData_merge(&dm2->faceData, &result->faceData, CD_MASK_DERIVEDMESH,
+ CustomData_merge(&dm2->faceData, &result->faceData, CD_MASK_DERIVEDMESH & ~CD_MASK_NORMAL,
CD_DEFAULT, face_it->num_elements);
// step through the vertex iterators:
@@ -466,6 +466,17 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
CDDM_calc_edges_tessface(result);
CDDM_tessfaces_to_faces(result); /*builds ngon faces from tess (mface) faces*/
+
+ /* this fixes shading issues but SHOULD NOT.
+ * TODO, find out why face normals are wrong & flicker - campbell */
+#if 0
+ DM_debug_print(result);
+
+ CustomData_free(&result->faceData, result->numTessFaceData);
+ result->numTessFaceData = 0;
+ DM_ensure_tessface(result);
+#endif
+
CDDM_calc_normals(result);
return result;