diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-11-17 23:50:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-11-18 02:52:00 +0300 |
commit | 22931f2f9f35c2f227639a534ced53fece57a8a6 (patch) | |
tree | e3c335ff3b91d5ec6c34122f40a0abda73f500ad /source/blender/modifiers/intern/MOD_decimate.c | |
parent | d6f9ba76a5cee06aa9ec795b4611216434a1a9cf (diff) |
BMesh: symmetry aware decimate
Support for decimating while maintaining symmetry on a single axis.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_decimate.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_decimate.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index 14468ab7c12..617ae5a89f3 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -94,7 +94,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm = derivedData, *result = NULL; BMesh *bm; bool calc_face_normal; - float *vweights = NULL; #ifdef USE_TIMEIT @@ -165,7 +164,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, case MOD_DECIM_MODE_COLLAPSE: { const bool do_triangulate = (dmd->flag & MOD_DECIM_FLAG_TRIANGULATE) != 0; - BM_mesh_decimate_collapse(bm, dmd->percent, vweights, dmd->defgrp_factor, do_triangulate); + const int symmetry_axis = (dmd->flag & MOD_DECIM_FLAG_SYMMETRY) ? dmd->symmetry_axis : -1; + const float symmetry_eps = 0.00002f; + BM_mesh_decimate_collapse( + bm, dmd->percent, vweights, dmd->defgrp_factor, do_triangulate, + symmetry_axis, symmetry_eps); break; } case MOD_DECIM_MODE_UNSUBDIV: |