diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-22 21:19:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-22 21:19:05 +0400 |
commit | 23baf8c9c366a6f4e029de0119e72de45722d1f0 (patch) | |
tree | 16bf608f71c21878ae02d554d9bb0455db9d4bf2 /source/blender/modifiers/intern/MOD_weightvgproximity.c | |
parent | 612768760ada094b0a6d47982d747394830a7a71 (diff) |
code cleanup: check defgroup_name_index() return value != -1, rather then checking >= 0.
also remove unused bmesh decimator code.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgproximity.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgproximity.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 25a2a61d8e3..a370bebf0e9 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -347,7 +347,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der int numVerts; float (*v_cos)[3] = NULL; /* The vertices coordinates. */ Object *obr = NULL; /* Our target object. */ - int defgrp_idx; + int defgrp_index; float *tw = NULL; float *org_w = NULL; float *new_w = NULL; @@ -378,8 +378,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der return dm; /* Get vgroup idx from its name. */ - defgrp_idx = defgroup_name_index(ob, wmd->defgrp_name); - if (defgrp_idx < 0) + defgrp_index = defgroup_name_index(ob, wmd->defgrp_name); + if (defgrp_index == -1) return dm; dvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MDEFORMVERT, numVerts); @@ -394,7 +394,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der tw = MEM_mallocN(sizeof(float) * numVerts, "WeightVGProximity Modifier, tw"); tdw = MEM_mallocN(sizeof(MDeformWeight *) * numVerts, "WeightVGProximity Modifier, tdw"); for (i = 0; i < numVerts; i++) { - MDeformWeight *_dw = defvert_find_index(&dvert[i], defgrp_idx); + MDeformWeight *_dw = defvert_find_index(&dvert[i], defgrp_index); if (_dw) { tidx[numIdx] = i; tw[numIdx] = _dw->weight; @@ -509,7 +509,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der wmd->mask_tex_map_obj, wmd->mask_tex_uvlayer_name); /* Update vgroup. Note we never add nor remove vertices from vgroup here. */ - weightvg_update_vg(dvert, defgrp_idx, dw, numIdx, indices, org_w, FALSE, 0.0f, FALSE, 0.0f); + weightvg_update_vg(dvert, defgrp_index, dw, numIdx, indices, org_w, FALSE, 0.0f, FALSE, 0.0f); /* If weight preview enabled... */ #if 0 /* XXX Currently done in mod stack :/ */ |