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 7 additions and 7 deletions
Showing only changes of commit f4f5969e07 - Show all commits

View File

@ -3441,6 +3441,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
EffectorWeights *clmd_effweights;
int totpoint;
int totedge;
float(*deformedVerts)[3];
bool realloc_roots;
if (!psys->clmd) {
@ -3494,13 +3495,12 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
psys->clmd->sim_parms->effector_weights = psys->part->effector_weights;
BKE_id_copy_ex(NULL, &psys->hair_in_mesh->id, (ID **)&psys->hair_out_mesh, LIB_ID_COPY_LOCALIZE);
clothModifier_do(psys->clmd,
sim->depsgraph,
sim->scene,
sim->ob,
psys->hair_in_mesh,
BKE_mesh_vert_positions_for_write(psys->hair_in_mesh));
BKE_mesh_tag_positions_changed(psys->hair_in_mesh);
deformedVerts = BKE_mesh_vert_coords_alloc(psys->hair_out_mesh, NULL);
clothModifier_do(
psys->clmd, sim->depsgraph, sim->scene, sim->ob, psys->hair_in_mesh, deformedVerts);
BKE_mesh_vert_coords_apply(psys->hair_out_mesh, deformedVerts);
sixthat marked this conversation as resolved Outdated

The update tag from BKE_mesh_vert_coords_apply is missing here too.

The update tag from `BKE_mesh_vert_coords_apply` is missing here too.
MEM_freeN(deformedVerts);
/* restore cloth effector weights */
psys->clmd->sim_parms->effector_weights = clmd_effweights;