diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-14 05:54:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-14 05:54:03 +0400 |
commit | dd3b729d62743120250fa33a02200035cf9d53e9 (patch) | |
tree | 204f37e4956d3b5795a084d933ee4159b09aa024 /source | |
parent | e6b0a779561afabe55af422da1d538b5e95cecc1 (diff) |
mask modifier was taking into account zero weighted verts.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/modifiers/intern/MOD_mask.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index b36d6848533..8f435cc6e4f 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -202,7 +202,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (BLI_ghash_haskey(boneHash, SET_INT_IN_POINTER(dvert[i].dw[j].def_nr))) { def_weight = &dvert[i].dw[j]; - break; + if(def_weight->weight != 0.0f) { + break; + } } } @@ -243,26 +245,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, /* add vertices which exist in vertexgroup into ghash for filtering */ for (i = 0; i < maxVerts; i++) { - MDeformWeight *def_weight = NULL; - int j; - - for (j= 0; j < dvert[i].totweight; j++) - { - if (dvert[i].dw[j].def_nr == defgrp_index) - { - def_weight = &dvert[i].dw[j]; - break; - } - } + const int weight_set= defvert_find_weight(dvert + i, defgrp_index) != 0.0f; /* check if include vert in vertHash */ if (mmd->flag & MOD_MASK_INV) { /* if this vert is in the vgroup, don't include it in vertHash */ - if (def_weight) continue; + if (weight_set) continue; } else { /* if this vert isn't in the vgroup, don't include it in vertHash */ - if (!def_weight) continue; + if (!weight_set) continue; } /* add to ghash for verts (numVerts acts as counter for mapping) */ |