diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-03 19:28:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-03 19:28:53 +0400 |
commit | 8d8403c15ec8694d7d71d8a9f4a9e3a1fade666e (patch) | |
tree | d938809a9b5c5ec2975d347d70b4bc89cbf59404 /source/blender/modifiers/intern/MOD_decimate.c | |
parent | 0a1e48fa7878328d143b9a348104853a228cdb26 (diff) |
for modifiers that are stull creating MFaces - call CDDM_tessfaces_to_faces rather then making an entire copy with CDDM_copy(result, 1)
Diffstat (limited to 'source/blender/modifiers/intern/MOD_decimate.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_decimate.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index dca6d6a8a31..d14edd6d428 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -181,12 +181,14 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), MEM_freeN(lod.vertex_normal_buffer); MEM_freeN(lod.triangle_index_buffer); - dm = CDDM_copy(result, 1); /*builds ngon faces from tess (mface) faces*/ - CDDM_calc_normals(dm); - result->needsFree = 1; - result->release(result); + if (result) { + CDDM_tessfaces_to_faces(result); /*builds ngon faces from tess (mface) faces*/ - return dm; + return result; + } + else { + return dm; + } } #else // WITH_MOD_DECIMATE static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob), |