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-05-30 21:36:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-30 21:36:43 +0400
commit09e11ad6ef1187d581b64a9ac6ebbbb6f056f7d9 (patch)
tree7f3100eed9f03496573b80ead9a8f3cf32e75b3b /source/blender/modifiers/intern/MOD_array.c
parent1be293629833a43a5ecf3a76c6ed838d183a2683 (diff)
modifier stack: lazy initialize normals
many modifiers were calculating normals, when those normals were ignored by the next modifier. now flag normals as dirty and recalculate for modifiers that set use `dependsOnNormals()` callback. Quick test on mesh with 12 modifiers (mostly build type), calculated normals 6 times, now it only runs once - so this will give some speedup too.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_array.c')
-rw-r--r--source/blender/modifiers/intern/MOD_array.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index a1fdae5792c..902afd2ed41 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -565,11 +565,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
if ((amd->offset_type & MOD_ARR_OFF_OBJ) && (amd->offset_ob)) {
/* Update normals in case offset object has rotation. */
-
- /* BMESH_TODO: check if normal recalc needed under any other
- * conditions? */
-
- CDDM_calc_normals(result);
+ result->dirty |= DM_DIRTY_NORMALS;
}
BM_mesh_free(bm);
@@ -591,9 +587,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
result = arrayModifier_doArray(amd, md->scene, ob, dm, 0);
- //if (result != dm)
- // CDDM_calc_normals_mapping(result);
-
return result;
}