Expressions (Maya)

From TOI-Pedia

Expressions control attributes (properties) of Maya objects. They can be comprised of mathematical equations, conditional statements, or MEL commands. Expressions are very powerful as you can control attribute values in very intricate ways. You can make them behave as 'intelligent' as you want (or can).


Related options to control attribute values other than giving them a fixed value are: keys (animation), constraints, motion path, and dynamics. Note that none of these can be combined for a single attribute.

Applications

There are two main categories for the application of expressions:

  1. Parametric design
  2. Animation

When use for parametric design, you can link an attribute of one object to specific attributes of other objects, creating a relation between the two. If the one changes, the other will automatically follow (with some kind of calculation)

pCube1.translateX = pCube2.translateX + 4;
/* this expression causes the X position of pCube2 to always be 4 more than the X position of pCube1 */

The main application however is for animation purposes. If there is some kind of 'rule' or order in an animation, chances are you can create the animation using an expression. Especially animation with some sort of mathematical order are prime candidates for expressions.

pSphere1.translateY = sin(time);
/* this expression causes the Y position of pSphere1 to follow a sinusoid (time driven)*/

Create and edit expressions

Personal tools
Actions
Navigation
Tools