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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-02-26 22:12:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-02-26 22:12:01 +0400
commitc956e5d2d92f8a687e6f884602a12adade7b6c09 (patch)
treec26ad34cad282c16ffda022efd57c2eb10d2619e /source
parent6bc7c30b9346e8a382de6a47cd4c14e6e134fc1d (diff)
modified fix for "Fix [#30351] Solidify Modifier High Quality Normals fails." from r44464.
rather then recalc polygon normals - solidify is simple enough to just flip the normals of the copied faces, the rim faces normals are already re-calculated so copy them.
Diffstat (limited to 'source')
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c2
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c17
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c18
3 files changed, 16 insertions, 21 deletions
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index afcfcc396ee..89e47094108 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -183,7 +183,7 @@ static void createFacepa(ExplodeModifierData *emd,
BLI_kdtree_free(tree);
}
-static int edgecut_get(EdgeHash *edgehash, int v1, int v2)
+static int edgecut_get(EdgeHash *edgehash, unsigned int v1, unsigned int v2)
{
return GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, v1, v2));
}
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index 8ff4080b99b..92e50d36b1b 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -132,23 +132,6 @@ static void copyData(ModifierData *md, ModifierData *target)
tltmd->iter= sltmd->iter;
}
-#if 0
-static int findEd(MEdge *medge_new, int toted, int v1, int v2)
-{
- int i;
-
- for (i = 0; i < toted; i++) {
- if ( (medge_new[i].v1 == v1 && medge_new[i].v2 == v2) ||
- (medge_new[i].v1 == v2 && medge_new[i].v2 == v1) )
- {
- return i;
- }
- }
-
- return -1;
-}
-#endif
-
static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData,
int useRenderParams,
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index defc2b9de5e..78178387ee9 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -235,6 +235,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
float (*vert_nors)[3]= NULL;
+ float (*face_nors_result)[3] = NULL;
+
const float ofs_orig= - (((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
const float ofs_new= smd->offset - (((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
const float offset_fac_vg= smd->offset_fac_vg;
@@ -354,7 +356,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DM_copy_poly_data(dm, result, 0, 0, numFaces);
DM_copy_poly_data(dm, result, 0, numFaces, numFaces);
-
+
+ /* if the original has it, get the result so we can update it */
+ face_nors_result = CustomData_get_layer(&result->polyData, CD_NORMAL);
+
/*flip normals*/
mp = mpoly + numFaces;
for (i=0; i<dm->numPolyData; i++, mp++) {
@@ -384,6 +389,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
ml2[j].e += numEdges;
ml2[j].v += numVerts;
}
+
+ if (face_nors_result) {
+ negate_v3_v3(face_nors_result[numFaces + i], face_nors_result[i]);
+ }
}
for(i=0, ed=medge+numEdges; i<numEdges; i++, ed++) {
@@ -667,6 +676,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
add_v3_v3(edge_vert_nos[ed->v1], nor);
add_v3_v3(edge_vert_nos[ed->v2], nor);
+
+ if (face_nors_result) {
+ copy_v3_v3(face_nors_result[(numFaces * 2) + i], nor);
+ }
#endif
}
@@ -702,8 +715,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
MEM_freeN(old_vert_arr);
/* must recalculate normals with vgroups since they can displace unevenly [#26888] */
- /* Also needed in case of HQ normals [#30351] (don't really undestand why, though... --mont29). */
- if (dvert || smd->flag & MOD_SOLIDIFY_NORMAL_CALC) {
+ if (dvert) {
CDDM_calc_normals(result);
}