Maya Instancer

Age: (float)

This is where you determine how fast the particles move through the instanced object list. For example, if you have an instanced object that has a walk cycle, you can modify how fast each object is walking and control the rate at which the particle cycles through the walk cycle. This will fine tune your animation and it’s also how you prevent your character’s feet from sliding along the surface while walking, like Gumby. To do this you would create a custom float PP attribute called custom_age that has a runtime expression:

float $speed = mag(particleShape.veolicty);

particleShape.custom_age = particleShape.age * ($speed / 10);

The number 10 is something you will have to adjust and fine tune your animation to get your feet not to slide as your instances walk through your scene. This also adjusts your walk cycle to be determined by how fast your instance character is walking. Thus you would get faster moving characters walking faster and slower ones walking slower.

Expression Scripting notes:

Runtime: A script that executes for every frame during a particles lifespan.

Creation: A script that executes only at the time of particle creation (birth).

Variable: A term used to describe a temporary holding space for information. Maya uses the $ symbol followed by any text to determine a variable. All variables must start with a $ and can contain alphanumeric characters. However, the name must begin with an alpha character, not a number. So, $temp2 would be valid, but $2temp would cause a syntax error. Scripting in Maya is also case sensitive so $temp and $Temp are two different variables.

Float: Any real number, fractional or whole.

Vector: Any number with 3 positions of value like XYZ or RGB. Vectors are determined with two < and two > surrounding them and a comma (,) separating the values.

Ex. <<X, Y, Z>> or <<R, G, B>>

mag( ) a function that will give you the square root of the sum of all vector positions, squared. Ex. mag(<<2, 2, 2>>); returns the √ 2² + 2² + 2² which is 3.464102.

rand( ) a function that will give you a random number. Ex. rand(2,5); gives a random value between 2 and 5. If you use a single number like rand(5); you will get a random number between 0 and that number (5). Thus, rand(0,5) is the same as rand(5).

sphrand( ) a function that will give you a random vector based on an imaginary sphere. Ex. sphrand(3); would give a random vector value like <<2, -1.4, .785>> with all 3 positions (xyz/rgb) being between -3 and 3. Note than when dealing with color values, a negative number from sphrand( ) will result in 0 being returned. So the previous example would result in <<2, 0, .785>>.

Back - Page 5
Jump to Page: 1, 2, 3, 4, 5, 6