Fix ghash return value on 'Correct Face Attributes' with 'Keep Connect'

The result was somewhat unpredictable.
This error was recently introduced.
This commit is contained in:
Germano Cavalcante 2020-07-29 19:17:56 -03:00
parent 81ce8481b2
commit 699cefefd0
Notes: blender-bot 2023-02-14 05:53:42 +01:00
Referenced by issue #79393, Eevee motion blur works the other way around
1 changed files with 5 additions and 6 deletions

View File

@ -1094,10 +1094,11 @@ static BMFace *mesh_customdatacorrect_face_substitute_get(BMFace *f_copy)
#endif /* USE_FACE_SUBSTITUTE */
static void mesh_customdatacorrect_init_vert(struct TransCustomDataLayer *tcld,
BMVert *v,
struct TransDataBasic *td,
const int index)
{
BMesh *bm = tcld->bm;
BMVert *v = td->extra;
BMIter liter;
int j, l_num;
float *loop_weights;
@ -1149,7 +1150,7 @@ static void mesh_customdatacorrect_init_vert(struct TransCustomDataLayer *tcld,
merge_data->cd_loop_groups = NULL;
}
BLI_ghash_insert(tcld->merge_group.origverts, v, merge_data);
BLI_ghash_insert(tcld->merge_group.origverts, v, td);
}
}
@ -1243,14 +1244,12 @@ static void mesh_customdatacorrect_init_container(TransDataContainer *tc,
TransData *tob = tc->data;
for (int j = tc->data_len; j--; tob++, i++) {
BMVert *v = tob->extra;
mesh_customdatacorrect_init_vert(tcld, v, i);
mesh_customdatacorrect_init_vert(tcld, (TransDataBasic *)tob, i);
}
TransDataMirror *td_mirror = tc->data_mirror;
for (int j = tc->data_mirror_len; j--; td_mirror++, i++) {
BMVert *v = td_mirror->extra;
mesh_customdatacorrect_init_vert(tcld, v, i);
mesh_customdatacorrect_init_vert(tcld, (TransDataBasic *)td_mirror, i);
}
}