Revision: 60989 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60989 Author: lukastoenne Date: 2013-10-29 14:48:25 +0000 (Tue, 29 Oct 2013) Log Message: ----------- Fix for particle texture influence bug causing undefined (nan) values: When using a texture with "Particles/Strands" coordinates that in turn has a "Lifetime" influence on the particles, the texture eval accesses the particle lifetime/dietime data before it is actually defined! This is a design flaw, but to avoid corrupted data for now just initialize the lifetime/dietime values for particles in advance before evaluating the texture.
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 2013-10-29 11:59:03 UTC (rev 60988) +++ trunk/blender/source/blender/blenkernel/intern/particle_system.c 2013-10-29 14:48:25 UTC (rev 60989) @@ -2006,6 +2006,12 @@ 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); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs