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 10:13:56 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-23 10:13:56 +0400
commita82af0d220835970f83c63ade5e1b2309a993ec5 (patch)
tree3285c6d27b348b32d91909ab794ad6ce22ca8ffd /source/blender/modifiers
parentc29760566529c4d5ddbd74734d486fd17a3e5811 (diff)
add option to planar decimator to collapse all verts that define face boundries (verts that 2 faces share and have 2 edge users).
avoids ugly stepping between faces when applying on curves surfaces. (but less useful for architectural style models)
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_decimate.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c
index cb6eb127172..a9bc9cbf83a 100644
--- a/source/blender/modifiers/intern/MOD_decimate.c
+++ b/source/blender/modifiers/intern/MOD_decimate.c
@@ -100,8 +100,6 @@ 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
@@ -148,14 +146,22 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
switch (dmd->mode) {
case MOD_DECIM_MODE_COLLAPSE:
+ {
+ const int do_triangulate = (dmd->flag & MOD_DECIM_FLAG_TRIANGULATE) != 0;
BM_mesh_decimate_collapse(bm, dmd->percent, vweights, do_triangulate);
break;
+ }
case MOD_DECIM_MODE_UNSUBDIV:
+ {
BM_mesh_decimate_unsubdivide(bm, dmd->iter);
break;
+ }
case MOD_DECIM_MODE_DISSOLVE:
- BM_mesh_decimate_dissolve(bm, dmd->angle);
+ {
+ const int do_dissolve_boundaries = (dmd->flag & MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS) != 0;
+ BM_mesh_decimate_dissolve(bm, dmd->angle, do_dissolve_boundaries);
break;
+ }
}
if (vweights) {