Fix for particle emission bug, reported on IRC by Thomas Beck

(@plasmasolutions): When the particle emitter is parented to a fast
moving object, the emission locations will not be interpolated over
subframes. This works if the particle emitter is animated itself.
Particle system evaluates the emitter location for each subframe, but
has to do this for the parent objects as well to get reliable results.
This commit is contained in:
Lukas Tönne 2014-01-22 16:26:09 +01:00
parent 51c32ac199
commit c24a23f264
Notes: blender-bot 2023-02-14 10:44:51 +01:00
Referenced by issue #39923, particle emitter not emitting in the same frequency when being parented to an empty, or object with rigid body dynamics.
1 changed files with 2 additions and 2 deletions

View File

@ -1974,10 +1974,10 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
/* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */
while (ob) {
BKE_animsys_evaluate_animdata(sim->scene, &ob->id, ob->adt, pa->time, ADT_RECALC_ANIM);
BKE_object_where_is_calc_time(sim->scene, ob, pa->time);
ob = ob->parent;
}
ob = sim->ob;
BKE_object_where_is_calc_time(sim->scene, ob, pa->time);
psys->flag |= PSYS_OB_ANIM_RESTORE;
}
@ -5076,10 +5076,10 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
if (psys->flag & PSYS_OB_ANIM_RESTORE) {
while (ob) {
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, cfra, ADT_RECALC_ANIM);
BKE_object_where_is_calc_time(scene, ob, cfra);
ob = ob->parent;
}
ob = sim.ob;
BKE_object_where_is_calc_time(scene, ob, cfra);
psys->flag &= ~PSYS_OB_ANIM_RESTORE;
}