diff options
Diffstat (limited to 'source/blender/editors/armature/armature_skinning.c')
-rw-r--r-- | source/blender/editors/armature/armature_skinning.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c index ea9b0eb92b9..aa742d4b7ba 100644 --- a/source/blender/editors/armature/armature_skinning.c +++ b/source/blender/editors/armature/armature_skinning.c @@ -212,10 +212,6 @@ static void envelope_bone_weighting(Object *ob, { /* Create vertex group weights from envelopes */ - Bone *bone; - bDeformGroup *dgroup; - float distance; - int i, iflip, j; bool use_topology = (mesh->editflag & ME_EDIT_MIRROR_TOPO) != 0; bool use_mask = false; @@ -225,30 +221,30 @@ static void envelope_bone_weighting(Object *ob, } /* for each vertex in the mesh */ - for (i = 0; i < mesh->totvert; i++) { + for (int i = 0; i < mesh->totvert; i++) { if (use_mask && !(mesh->mvert[i].flag & SELECT)) { continue; } - iflip = (dgroupflip) ? mesh_get_x_mirror_vert(ob, NULL, i, use_topology) : -1; + int iflip = (dgroupflip) ? mesh_get_x_mirror_vert(ob, NULL, i, use_topology) : -1; /* for each skinnable bone */ - for (j = 0; j < numbones; j++) { + for (int j = 0; j < numbones; j++) { if (!selected[j]) { continue; } - bone = bonelist[j]; - dgroup = dgrouplist[j]; + Bone *bone = bonelist[j]; + bDeformGroup *dgroup = dgrouplist[j]; /* store the distance-factor from the vertex to the bone */ - distance = distfactor_to_bone(verts[i], - root[j], - tip[j], - bone->rad_head * scale, - bone->rad_tail * scale, - bone->dist * scale); + float distance = distfactor_to_bone(verts[i], + root[j], + tip[j], + bone->rad_head * scale, + bone->rad_tail * scale, + bone->dist * scale); /* add the vert to the deform group if (weight != 0.0) */ if (distance != 0.0f) { @@ -300,7 +296,7 @@ static void add_verts_to_dgroups(ReportList *reports, Mat4 bbone_array[MAX_BBONE_SUBDIV], *bbone = NULL; float(*root)[3], (*tip)[3], (*verts)[3]; int *selected; - int numbones, vertsfilled = 0, i, j, segments = 0; + int numbones, vertsfilled = 0, segments = 0; const bool wpmode = (ob->mode & OB_MODE_WEIGHT_PAINT); struct { Object *armob; @@ -346,7 +342,7 @@ static void add_verts_to_dgroups(ReportList *reports, tip = MEM_callocN(sizeof(float[3]) * numbones, "tip"); selected = MEM_callocN(sizeof(int) * numbones, "selected"); - for (j = 0; j < numbones; j++) { + for (int j = 0; j < numbones; j++) { bone = bonelist[j]; dgroup = dgrouplist[j]; @@ -427,7 +423,7 @@ static void add_verts_to_dgroups(ReportList *reports, } /* transform verts to global space */ - for (i = 0; i < mesh->totvert; i++) { + for (int i = 0; i < mesh->totvert; i++) { if (!vertsfilled) { copy_v3_v3(verts[i], mesh->mvert[i].co); } |