Maya: Some Expressions:

arrows.GIF

List of Mel commands: Help->Maya Scripting Reference->MEL Command Reference

To add expressions onto a channel:
Select Object -> Go to Channel Box/ Layer Editor
Select the Channel you want to add expressions onto (eg Translate Z)
Go to Edit inside Channel Box -> Expressions
Type in the Expression.


Wheels on a car:
  apply to the wheel rotate in z channel
rz =  car.tx /   (2*3.1416)  *  1   *   360
wheel  car            pi        wheel size     1 rotation



Windshield wipers:  apply to the wiper rotate in x channel
rx =   (sin  (.9  *  time) *  45) +   10
wiper         sine  speed   time   degree  offset for position



Volumetric squashing for a ball: pg 26 Learning Maya
apply to the ball scale in x channel  sx = 1/sy
apply to the ball scale in x channel  sz = 1/sy



Start an Expression at a Certain Frame:
output yes if frame is greater than 20, uses backward single quote (same key as "~")

$c = "no";

if (`currentTime -query` > 20) {
    $c = "yes";
}
print $c;


Embedded Sin Waves for a Random Effect
ty = sin (sin (.5 * time) * time);



Use noise for a random effect
ty = noise(time);



Set Driven Key:
This is similar to expressions, except Maya writes the expression for you.
Go to the Animation section of Maya

Bring up two shapes

Key->Set Driven Key->Set...
Select the controller shape

Click Load Driver Button in Driven Key window

Select the other shape

Click Load Driven Button in Driven Key window

Select both shapes

Select the channels you would like to control
Driver Translate x
Driven Rotate x
for example

Click key Button in Driven Key window, this establishes the neutral position

Translate, Rotate, etc. the two objects

Select both objects

Click key Button in Driven Key window, this establishes the neutral position

You could use this to create control handles for your IK skeleton