Revision: 49647
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49647
Author:   lukastoenne
Date:     2012-08-07 10:54:50 +0000 (Tue, 07 Aug 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/particle.c

Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c   2012-08-07 
10:10:03 UTC (rev 49646)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c   2012-08-07 
10:54:50 UTC (rev 49647)
@@ -3876,7 +3876,10 @@
                                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;
                        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to