Fix for #11740 - Reactor particles do not render in animation.

- Particle data was deleted when the current frame was outside the baked range. Reactor particles need this data to store birth and death times.
This commit is contained in:
2008-09-13 21:06:22 +00:00
parent fa825e70e3
commit 06be41648f
2 changed files with 12 additions and 3 deletions

View File

@@ -302,6 +302,7 @@ int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int
#define PSYS_RESET_ALL 1
#define PSYS_RESET_DEPSGRAPH 2
#define PSYS_RESET_CHILDREN 3
#define PSYS_RESET_CACHE_MISS 4
/* ParticleEffectorCache->type */
#define PSYS_EC_EFFECTOR 1

View File

@@ -150,6 +150,14 @@ void psys_reset(ParticleSystem *psys, int mode)
BLI_freelistN(&psys->reactevents);
}
}
else if(mode == PSYS_RESET_CACHE_MISS) {
/* set all particles to be skipped */
ParticleData *pa = psys->particles;
int p=0;
for(; p<psys->totpart; p++, pa++)
pa->flag = PARS_NO_DISP;
}
/* reset children */
if(psys->child) {
@@ -4473,7 +4481,7 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
if(usecache) {
/* frame clamping */
if(framenr < startframe) {
psys_reset(psys, PSYS_RESET_DEPSGRAPH);
psys_reset(psys, PSYS_RESET_CACHE_MISS);
psys->cfra = cfra;
psys->recalc = 0;
return;
@@ -4553,14 +4561,14 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
return;
}
else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) {
psys_reset(psys, PSYS_RESET_DEPSGRAPH);
psys_reset(psys, PSYS_RESET_CACHE_MISS);
psys->cfra=cfra;
psys->recalc = 0;
return;
}
if(framenr != startframe && framedelta != 1) {
psys_reset(psys, PSYS_RESET_DEPSGRAPH);
psys_reset(psys, PSYS_RESET_CACHE_MISS);
psys->cfra = cfra;
psys->recalc = 0;
return;