Thursday, 8 March 2012

Maya - Expressions

While I remember I thought I'd record the expressions I've been using so far.

= rand(<<0.6,0.4,0.2>>,<<1,0.6,0.4>>);

Adding the above to the 'Per Particle (Array) Attributes', 'colour' channel gives random RGB values for particle sparks/fireworks etc.

= sin (time*1)*30,
or
= -sin (time*1)*30

Add above to a 'rotate' channel on an oject to animate the object swinging back and forth.

= time*50;

Add to a 'rotate' channel on an object to make it spin.


Below are attributes that are added to particles when using particles to create multiple objects using 'Instancer (Replacement)'.


Below is added to a 'Per Particle (Array) Attributes' custom scale/custom rotate and custom number channels made by using 'general', 'new', 'float' for '()' and vector for <<>> attributes and calling it 'customScale/Rotate of Number'. This expression controls the size and rotation of the particles.
 
particleShape1.customScale = rand(0.2,1.5);

particleShape1.customRotate = <<rand (360),rand (360),rand (360)>>;

particleShape1.customNumber = rand (1,-1);

Then

particleShape1.customRotate += particleShape1.customNumber*5;

is added as a 'runtime before dynaimics' expression.

No comments:

Post a Comment