diff options
author | Janne Karhu <jhkarh@gmail.com> | 2009-12-26 18:59:07 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2009-12-26 18:59:07 +0300 |
commit | 20ab9a4d9bcfab7c0843ee21f9a3f7976ab530cc (patch) | |
tree | 5cbcfafdff09cd31a92a253966549ea85ddcbe05 /source | |
parent | 944a4f2a3ff300e30c79e7f87a22d0960fc44f95 (diff) |
Particles bug fix: Particle birth location between frames weren't calculated correctly for moving emitters as the functionality of where_is_object_time has changed a bit in the new anim system.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index d3dacadca53..bf8721fd0b0 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -37,6 +37,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_anim_types.h" #include "DNA_boid_types.h" #include "DNA_particle_types.h" #include "DNA_mesh_types.h" @@ -62,6 +63,7 @@ #include "BLI_threads.h" #include "BKE_anim.h" +#include "BKE_animsys.h" #include "BKE_boids.h" #include "BKE_cdderivedmesh.h" #include "BKE_collision.h" @@ -1720,8 +1722,11 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, } else{ /* get precise emitter matrix if particle is born */ - if(part->type!=PART_HAIR && pa->time < cfra && pa->time >= sim->psys->cfra) + if(part->type!=PART_HAIR && pa->time < cfra && pa->time >= sim->psys->cfra) { + /* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */ + BKE_animsys_evaluate_animdata(&sim->ob->id, sim->ob->adt, pa->time, ADT_RECALC_ANIM); where_is_object_time(sim->scene, sim->ob, pa->time); + } /* get birth location from object */ if(part->tanfac!=0.0) @@ -3298,8 +3303,9 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) /* nothing to be done when particle is dead */ } - /* only reset unborn particles if they're shown */ - if(pa->alive==PARS_UNBORN && part->flag & PART_UNBORN) + /* only reset unborn particles if they're shown or if the particle is born soon*/ + if(pa->alive==PARS_UNBORN + && (part->flag & PART_UNBORN || cfra + psys->pointcache->step > pa->time)) reset_particle(sim, pa, dtime, cfra); if(dfra>0.0 && ELEM(pa->alive,PARS_ALIVE,PARS_DYING)){ |