Common expression errors

 
 
 

There are two types of errors you can make when writing expressions: syntax errors and logic errors. Syntax errors include mistakes in spelling, incomplete attribute names, omitted semicolons, and other oversights that prevent the expression from compiling and executing. For syntax errors, Maya explains the error in a message to the Script Editor.

Logic errors are mistakes in your reasoning that cause unexpected animation results. The syntax of your expression is valid, but errors in your logic prevent Maya from doing what you intended. In the worst cases, Maya might halt operation because your statements lock it into a permanent loop.

Because Maya can’t detect logic errors, it can’t display error messages. As such, these errors are harder to find and require more analysis to solve. To resolve logic errors, it’s often helpful to display the contents of relevant attributes and variables. See Display attribute and variable contents.