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:
-rw-r--r--source/blender/blenkernel/intern/particle_system.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 526d54a97fa..ac32f96d59c 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -2006,6 +2006,12 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
pa->lifetime = 100.0f;
}
else {
+ /* initialize the lifetime, in case the texture coordinates
+ * are from Particles/Strands, which would cause undefined values
+ */
+ pa->lifetime = part->lifetime * (1.0f - part->randlife * PSYS_FRAND(p + 21));
+ pa->dietime = pa->time + pa->lifetime;
+
/* get possible textural influence */
psys_get_texture(sim, pa, &ptex, PAMAP_LIFE, cfra);