Mesh: Avoid position copying in corrective smooth modifier

This is a place where copying mesh position is not needed. See #103789.

Pull Request: https://projects.blender.org/blender/blender/pulls/108291
This commit is contained in:
Chao Li
2023-05-25 22:12:11 +02:00
committed by Hans Goudey
parent c18cafe748
commit 72309be398

View File

@@ -653,12 +653,17 @@ static void correctivesmooth_modifier_do(ModifierData *md,
}
else {
int me_numVerts;
rest_coords = em ? BKE_editmesh_vert_coords_alloc_orco(em, &me_numVerts) :
BKE_mesh_vert_coords_alloc(static_cast<const Mesh *>(ob->data),
&me_numVerts);
if (em) {
rest_coords = BKE_editmesh_vert_coords_alloc_orco(em, &me_numVerts);
is_rest_coords_alloc = true;
}
else {
const Mesh *me = static_cast<const Mesh *>(ob->data);
rest_coords = BKE_mesh_vert_positions(me);
me_numVerts = me->totvert;
}
BLI_assert((uint)me_numVerts == verts_num);
is_rest_coords_alloc = true;
}
#ifdef DEBUG_TIME