Texture Driven Particles

Create Particle Grid in the "Particle Tool Settings"  (Dynamics -> Particles -> Particle Tool □)

  • Check the option "Create particle grid"
  • Click the option "With text fields"
  • Minimum corner settings:    x = -25, y =0, z= -25
  • Maximum corner settings: x = 25, y =0, z= 25
  • This will create a particle grid that is 51 particles x 51 particles in the x & y.

  • Click "General" under the "Per Particle (Array) Attributes".  
  • In the "Add Attributes" window, under the "Particle" tab add "radiusPP".  Click back to the "New" tab and type displacementValue next to "Long name:". Click "Vector" under "Data Type" and "Per particle (array)" under "Attribute Type" and hit the "Add" button on the bottom.  Now type vPP next to "Long name:".  Click "Float" under "Data Type" and click both the "Per particle (array)" and " Add initial state attribute" under "Attribute Type" and hit the "Add" button on the bottom.  Keep these same settings and type uPP next to "Long name:" and hit the "Add" button on the bottom.  Type hightPP next to "Long name:" and hit the "Add" button again on the bottom.  

  • You should of added these to your "Per Particle (Array) Attributes":

  • radiusPP             (under the particles tab)
  • displacementValue   (Vector, PP)
  • uPP                   (Float, PP, Add initial state attribute)
  • vPP                    (Float, PP, Add initial state attribute)
  • hightRamp          (Float, PP, Add initial state attribute)

  • With your "Hypershade" open, in the "Script Editor" type under the "MEL" tab, type and execute this string:

  • arrayMapper -target particleShape1 -destAttr displacementValue -inputU uPP -inputV vPP;

  • This should create an arrayMapper1 to your "Work Area" tab inside your "Hypershade". Create a black and white (preferably animated) texture, and call the node "file1".  Type this script and execute it in the "Script Editor":

  • connectAttr -f file1.message arrayMapper1.computeNode;
  • connectAttr -f file1.outColor arrayMapper1.computeNodeColor;

  • This will connect the texture file you created to your arrayMapper1.  

    Click back over to the "Per Particle (Array) Attributes" under your particles "Attribute Editor".  Right click in the box next to "RadiusPP" and click "Creation Expression..."  In the "Expression Editor" type under "Expression:"

  • int $u = 51;
  • int $v = 51;
  • particleShape1.vPP0=(particleShape1.particleId%$v)/($v-1);
  • particleShape1.uPP0=(particleShape1.particleId-(particleShape1.particleId%$v))/($v*($u-1));
  • particleShape1.radiusPP = .25;
  • particleShape1.hightPP = rand(0,1);

  • Click the "Create" button at the bottom.  Now click the "Runtime before dynamics" and type this in the "Expression:" window:

  • float $disp[]=particleShape1.displacementValue;
  • particleShape1.position = <<0, $disp[0]*15, 0>>+particleShape1.position0;
  • particleShape1.radiusPP = $disp[0]/2.55;

  • Click the "Create" button at the bottom.

    Close the "Expression Editor" and hit play on the timeline.  You should see not only the particles changing in size via the texture, but also translating along the Y.