Fix #108198: Particle hair crash when using Hair Dynamics #108480

Merged
Hans Goudey merged 2 commits from Chao-Li/blender:fix-hair-dynamics into blender-v3.6-release 2023-06-06 18:46:40 +02:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit 6df3448c9e - Show all commits

View File

@ -3491,12 +3491,14 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
}
}
hair_create_input_mesh(sim, totpoint, totedge, &psys->hair_in_mesh);
/* Free hair_out_mesh before modifying hair_in_mesh in hair_create_input_mesh() to avoid copying
* on write since they share some data */
if (psys->hair_out_mesh) {
BKE_id_free(NULL, psys->hair_out_mesh);
}
hair_create_input_mesh(sim, totpoint, totedge, &psys->hair_in_mesh);
psys->clmd->point_cache = psys->pointcache;
/* for hair sim we replace the internal cloth effector weights temporarily
* to use the particle settings