diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-28 06:49:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-28 06:49:06 +0400 |
commit | e35b235925608df1a8b06e4047592a363c3e28e9 (patch) | |
tree | 2f1e7dbea4229b933c3477d4af65a256145f45c8 /source/blender/modifiers | |
parent | 4fe35721e647126c6f929725d20064d279783ac3 (diff) |
fix [#33320] Decimate modifer in collapse is inconsistent when limiting to a vertex group
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_decimate.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index 3f8eaa438c9..28cdfa810fa 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -145,12 +145,14 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (dmd->flag & MOD_DECIM_FLAG_INVERT_VGROUP) { for (i = 0; i < vert_tot; i++) { - vweights[i] = 1.0f - defvert_find_weight(&dvert[i], defgrp_index); + const float f = 1.0f - defvert_find_weight(&dvert[i], defgrp_index); + vweights[i] = f > BM_MESH_DECIM_WEIGHT_EPS ? (1.0f / f) : BM_MESH_DECIM_WEIGHT_MAX; } } else { for (i = 0; i < vert_tot; i++) { - vweights[i] = defvert_find_weight(&dvert[i], defgrp_index); + const float f = defvert_find_weight(&dvert[i], defgrp_index); + vweights[i] = f > BM_MESH_DECIM_WEIGHT_EPS ? (1.0f / f) : BM_MESH_DECIM_WEIGHT_MAX; } } } |