Three fixes to corner indexing

This commit is contained in:
Hans Goudey 2022-12-20 09:50:06 -06:00
parent 1f13b64330
commit 6799dd1e88
3 changed files with 4 additions and 4 deletions

View File

@ -1991,7 +1991,7 @@ static void mesh_init_origspace(Mesh *mesh)
vcos_2d.resize(mp->totloop);
for (j = 0; j < mp->totloop; j++) {
mul_v3_m3v3(co, mat, positions[corner_verts[mp->totloop + j]]);
mul_v3_m3v3(co, mat, positions[corner_verts[mp->loopstart + j]]);
copy_v2_v2(vcos_2d[j], co);
for (k = 0; k < 2; k++) {

View File

@ -1605,7 +1605,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(const int mode,
BVHTreeFromMesh *tdata = &treedata[tindex];
for (plidx_dst = 0; plidx_dst < mp_dst->totloop; plidx_dst++) {
const int vert_dst_i = corner_verts_dst[mp_dst->totloop + plidx_dst];
const int vert_dst_i = corner_verts_dst[mp_dst->loopstart + plidx_dst];
if (use_from_vert) {
MeshElemMap *vert_to_refelem_map_src = nullptr;

View File

@ -554,8 +554,8 @@ BLI_INLINE SDefBindWeightData *computeBindWeights(SDefBindCalcData *const data,
}
for (int j = 0; j < poly->totloop; j++) {
const int vert_i = data->corner_verts[poly->totloop + j];
const int edge_i = data->corner_edges[poly->totloop + j];
const int vert_i = data->corner_verts[poly->loopstart + j];
const int edge_i = data->corner_edges[poly->loopstart + j];
copy_v3_v3(bpoly->coords[j], data->targetCos[vert_i]);
/* Find corner and edge indices within poly loop array */