Mel - Maya Embedded Language
Hints
Expressions are executed on every frame. Be wise in what you write. executing a loop on everyframe could be spendy.
Expressions can only access attributes of type float, int, or boolean.
avoid using setAttr and getAttr. instead directly set the objects attribute.
$float $myScale = box.scale;
box.scale = $myScale;
attributes with incoming connections already existing will not take an expression. Break connections on the
objects attribute before attempting to connect an expression to it.
It is not a good idea to delete or create objects through mel. Though, if you must make sure you delete the expression after it is run.
Otherwise you will populate your scene with multiple copies of an object if your play your timeline more than once.
To debug an expression insert print commands in your expression at points were you would
like to know the value of a variable or object attribute.
Just so you know... time = frame/rate
Use shorthand attribute calling to speed up expression writing.
translateX = tx
translateY = ty
translateZ = tz
rotateX = rx
rotateY = ry
rotateZ = rz
scaleX = sx
scaleY = sy
scaleZ = sz
visibility = v
If you are writing an expression under the by object/attribute name window view. You can omit the objects name and simply
call the attribute which you are setting.
Maya understands that tx = 10; would be the same as ball.translateX = 10;