From 9388d0491131e77dd8ff6e7b2960262c3378ab14 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Tue, 7 Aug 2012 10:54:50 +0000 Subject: [PATCH] Fix for particle influence textures. These now work with "Particle/Strand" input coordinates, mapping the relative particle index into the [-1, 1] Y-coordinate range. --- source/blender/blenkernel/intern/particle.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index c8b07e2ec11..ac0625d1bad 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3876,7 +3876,10 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex case TEXCO_PARTICLE: /* texture coordinates in range [-1, 1] */ texvec[0] = 2.f * (cfra - pa->time) / (pa->dietime - pa->time) - 1.f; - texvec[1] = 0.f; + if (sim->psys->totpart > 0) + texvec[1] = 2.f * (float)(pa - sim->psys->particles) / (float)sim->psys->totpart - 1.f; + else + texvec[1] = 0.0f; texvec[2] = 0.f; break; }