From 1ea210a8dcab7f9123e8680844835c876c61b0e4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Oct 2012 05:30:10 +0000 Subject: add option for decimate-collapse to keep triangulated geometry (normally quads stay as quads when not collapsed). --- source/blender/modifiers/intern/MOD_decimate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index 71b3b6c883b..cb6eb127172 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -100,6 +100,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, BMEditMesh *em; BMesh *bm; + const int do_triangulate = (dmd->flag & MOD_DECIM_FLAG_TRIANGULATE) != 0; + float *vweights = NULL; #ifdef USE_TIMEIT @@ -146,7 +148,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, switch (dmd->mode) { case MOD_DECIM_MODE_COLLAPSE: - BM_mesh_decimate_collapse(bm, dmd->percent, vweights); + BM_mesh_decimate_collapse(bm, dmd->percent, vweights, do_triangulate); break; case MOD_DECIM_MODE_UNSUBDIV: BM_mesh_decimate_unsubdivide(bm, dmd->iter); -- cgit v1.2.3