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

@@ -184,11 +184,9 @@ DerivedMesh *get_cddm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float
else {
dm = CDDM_copy(dm);
CDDM_apply_vert_coords(dm, vertexCos);
dm->dirty |= DM_DIRTY_NORMALS;
}
if (dm)
CDDM_calc_normals(dm);
return dm;
}
@@ -204,7 +202,7 @@ DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float (*
if (vertexCos) {
CDDM_apply_vert_coords(dm, vertexCos);
//CDDM_calc_normals(dm);
dm->dirty |= DM_DIRTY_NORMALS;
}
if (orco)