diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-30 21:36:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-30 21:36:43 +0400 |
commit | 09e11ad6ef1187d581b64a9ac6ebbbb6f056f7d9 (patch) | |
tree | 7f3100eed9f03496573b80ead9a8f3cf32e75b3b /source/blender/modifiers/intern/MOD_bevel.c | |
parent | 1be293629833a43a5ecf3a76c6ed838d183a2683 (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_bevel.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_bevel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 7cd10491c89..cbb0e05aa4a 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -171,7 +171,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, bm->ftoolflagpool == NULL); /* make sure we never alloc'd these */ BM_mesh_free(bm); - CDDM_calc_normals(result); + result->dirty |= DM_DIRTY_NORMALS; return result; } @@ -208,7 +208,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), /* until we allow for dirty normal flag, always calc, * note: calculating on the CDDM is faster then the BMesh equivalent */ - CDDM_calc_normals(result); + result->dirty |= DM_DIRTY_NORMALS; return result; } |