[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25567] trunk/blender/source/blender/ blenkernel/intern/particle_system.c: 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 .
Janne Karhu
jhkarh at utu.fi
Sat Dec 26 16:59:08 CET 2009
Revision: 25567
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25567
Author: jhk
Date: 2009-12-26 16:59:07 +0100 (Sat, 26 Dec 2009)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/particle_system.c
Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle_system.c 2009-12-26 09:36:50 UTC (rev 25566)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c 2009-12-26 15:59:07 UTC (rev 25567)
@@ -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 @@
}
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 @@
/* 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)){
More information about the Bf-blender-cvs
mailing list