Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-23 09:30:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-23 09:30:10 +0400
commit1ea210a8dcab7f9123e8680844835c876c61b0e4 (patch)
tree1dc9cc9e32f9685039dcef69484baab3cfdaabbc /source/blender/modifiers
parentbbe0deb8afb0094b169a9abb04df7458cd49786b (diff)
add option for decimate-collapse to keep triangulated geometry (normally quads stay as quads when not collapsed).
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_decimate.c4
1 files changed, 3 insertions, 1 deletions
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);