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.
This commit is contained in:
2013-05-30 17:36:43 +00:00
parent 1be2936298
commit 09e11ad6ef
23 changed files with 149 additions and 77 deletions

View File

@@ -136,7 +136,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
result = edgesplitModifier_do(emd, ob, derivedData);
if (result != derivedData)
CDDM_calc_normals(result);
result->dirty |= DM_DIRTY_NORMALS;
return result;
}