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>2013-06-02 08:09:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-02 08:09:29 +0400
commitec30e3f00ecd3e366e13c233e34793f0ba3179aa (patch)
tree813d854e995bf313029194e72b16f66b5f40e9b6 /source/blender/modifiers
parente648ca8862a2cee3723450b67f556e222b8b0d6b (diff)
corrections to modifiers from recent normal handling changes
- solidify didn't define a dependsOnNormals callback (which it should have) - build wasn't passing on dirty normals. - decimate wasnt setting dirty normals.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_build.c4
-rw-r--r--source/blender/modifiers/intern/MOD_decimate.c2
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c10
3 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c
index fe3a0641667..9e375b07972 100644
--- a/source/blender/modifiers/intern/MOD_build.c
+++ b/source/blender/modifiers/intern/MOD_build.c
@@ -296,6 +296,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
MEM_freeN(edgeMap);
MEM_freeN(faceMap);
+ if (dm->dirty & DM_DIRTY_NORMALS) {
+ result->dirty |= DM_DIRTY_NORMALS;
+ }
+
return result;
}
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c
index 2d3d5c97af7..b8dccd9ffbe 100644
--- a/source/blender/modifiers/intern/MOD_decimate.c
+++ b/source/blender/modifiers/intern/MOD_decimate.c
@@ -197,6 +197,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
TIMEIT_END(decim);
#endif
+ result->dirty = DM_DIRTY_NORMALS;
+
return result;
}
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index ef7f0050bb1..4ef5f11c91f 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -819,7 +819,7 @@ static DerivedMesh *applyModifier(
MEM_freeN(old_vert_arr);
/* must recalculate normals with vgroups since they can displace unevenly [#26888] */
- if (dvert) {
+ if ((dm->dirty & DM_DIRTY_NORMALS) || dvert) {
result->dirty |= DM_DIRTY_NORMALS;
}
@@ -832,6 +832,12 @@ static DerivedMesh *applyModifier(
#undef SOLIDIFY_SIDE_NORMALS
+static bool dependsOnNormals(ModifierData *md)
+{
+ SolidifyModifierData *smd = (SolidifyModifierData *) md;
+
+ return (smd->flag & MOD_SOLIDIFY_NORMAL_CALC) == 0;
+}
ModifierTypeInfo modifierType_Solidify = {
/* name */ "Solidify",
@@ -858,7 +864,7 @@ ModifierTypeInfo modifierType_Solidify = {
/* isDisabled */ NULL,
/* updateDepgraph */ NULL,
/* dependsOnTime */ NULL,
- /* dependsOnNormals */ NULL,
+ /* dependsOnNormals */ dependsOnNormals,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ NULL,
/* foreachTexLink */ NULL,