diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-24 11:24:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-24 11:24:11 +0400 |
commit | 2de2acc6819f7024f06a9dcdc4cc2346a1dd57f7 (patch) | |
tree | 3cf708af945985531baacb0268d86d268d81093a /source/blender/modifiers/intern/MOD_decimate.c | |
parent | 879d92062a703b9d7bd718432a37dc8e7dd4a9bc (diff) |
add CDDM_from_bmesh(), avoids using BMEditMesh in modifiers.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_decimate.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_decimate.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index b7b9384b4e8..a8033876037 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -48,7 +48,6 @@ #include "BKE_particle.h" #include "BKE_cdderivedmesh.h" -#include "BKE_tessmesh.h" #include "bmesh.h" // #define USE_TIMEIT @@ -97,7 +96,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, { DecimateModifierData *dmd = (DecimateModifierData *) md; DerivedMesh *dm = derivedData, *result = NULL; - BMEditMesh *em; BMesh *bm; float *vweights = NULL; @@ -159,8 +157,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } } - em = DM_to_editbmesh(dm, NULL, FALSE); - bm = em->bm; + bm = DM_to_bmesh(dm); switch (dmd->mode) { case MOD_DECIM_MODE_COLLAPSE: @@ -188,18 +185,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, /* update for display only */ dmd->face_count = bm->totface; - - BLI_assert(em->looptris == NULL); - result = CDDM_from_BMEditMesh(em, NULL, TRUE, FALSE); - BMEdit_Free(em); - MEM_freeN(em); + result = CDDM_from_bmesh(bm, FALSE); + BM_mesh_free(bm); #ifdef USE_TIMEIT - TIMEIT_END(decim); + TIMEIT_END(decim); #endif - CDDM_calc_normals(result); - return result; } |