Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2008-09-14 01:06:22 +0400
committerJanne Karhu <jhkarh@gmail.com>2008-09-14 01:06:22 +0400
commit06be41648ffe7be565fe5a1e117e3611384c667f (patch)
tree4bbe1a9e0d83542787a848e0f385e9200149229c
parentfa825e70e3d5f05a1a803d2be563c3b919adf4ed (diff)
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.
-rw-r--r--source/blender/blenkernel/BKE_particle.h1
-rw-r--r--source/blender/blenkernel/intern/particle_system.c14
2 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 944a9081679..ea1dc7407db 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -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
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index bac92af5bee..df193bc3802 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -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;