Mesh: Remove unnecessary mesh position copying #105756

Merged
Hans Goudey merged 6 commits from sixthat/blender:remove-unneccessary-vert-pos-copy into main 2023-03-19 00:26:41 +01:00
1 changed files with 6 additions and 1 deletions
Showing only changes of commit 0139d95cc8 - Show all commits

View File

@ -62,8 +62,13 @@ bool multiresModifier_reshapeFromObject(Depsgraph *depsgraph,
Object *src_eval = DEG_get_evaluated_object(depsgraph, src);
Mesh *src_mesh_eval = mesh_get_eval_final(depsgraph, scene_eval, src_eval, &CD_MASK_BAREMESH);
int num_deformed_verts;
float(*deformed_verts)[3] = BKE_mesh_vert_coords_alloc(src_mesh_eval, &num_deformed_verts);
sixthat marked this conversation as resolved Outdated

I'm not sure this one is right, since the deformed positions weren't applied back to the mesh afterwards before. If I'm right about that, feel free to leave this out, it can be tweaked more in the future.

I'm not sure this one is right, since the deformed positions weren't applied back to the mesh afterwards before. If I'm right about that, feel free to leave this out, it can be tweaked more in the future.
const bool result = multiresModifier_reshapeFromVertcos(
depsgraph, dst, mmd, BKE_mesh_vert_positions(src_mesh_eval), src_mesh_eval->totvert);
depsgraph, dst, mmd, deformed_verts, num_deformed_verts);
MEM_freeN(deformed_verts);
return result;
}