Fix T97679: Retrieving shape key normals modifies vertices

Caused by not using the proper duplicated `MVert` array.
Error in b0aaf6ff4a.
This commit is contained in:
Hans Goudey 2022-04-28 08:45:21 -05:00
parent 0ad73bb965
commit c9c95201d0
Notes: blender-bot 2023-12-08 16:39:08 +01:00
Referenced by issue #97679, MeshVertex.co contains incorrect data after calling ShapeKey.normals_polygon_get()
1 changed files with 2 additions and 2 deletions

View File

@ -2196,7 +2196,7 @@ void BKE_keyblock_mesh_calc_normals(struct KeyBlock *kb,
}
MVert *mvert = MEM_dupallocN(mesh->mvert);
BKE_keyblock_convert_to_mesh(kb, mesh->mvert, mesh->totvert);
BKE_keyblock_convert_to_mesh(kb, mvert, mesh->totvert);
const bool loop_normals_needed = r_loopnors != NULL;
const bool vert_normals_needed = r_vertnors != NULL || loop_normals_needed;
@ -2237,7 +2237,7 @@ void BKE_keyblock_mesh_calc_normals(struct KeyBlock *kb,
}
if (loop_normals_needed) {
short(*clnors)[2] = CustomData_get_layer(&mesh->ldata, CD_CUSTOMLOOPNORMAL); /* May be NULL. */
BKE_mesh_normals_loop_split(mesh->mvert,
BKE_mesh_normals_loop_split(mvert,
vert_normals,
mesh->totvert,
mesh->medge,