Fix #108198: Particle hair crash when using Hair Dynamics #108480
|
@ -367,6 +367,10 @@ void clothModifier_do(ClothModifierData *clmd,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Since implicit sharing is introduced, mesh data can be moved to other places.
|
||||
* Therefore some fields in simulation data need to be updated accordingly */
|
||||
clmd->clothObject->edges = reinterpret_cast<const vec2i *>(mesh->edges().data());
|
||||
|
||||
/* try to read from cache */
|
||||
bool can_simulate = (framenr == clmd->clothObject->last_frame + 1) &&
|
||||
!(cache->flag & PTCACHE_BAKED);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue