Here are some common syntax errors and their explanations:
You misspelled an attribute name, the attribute doesn’t exist in the scene, or you forgot to prefix a variable name with $.
You used a particle array attribute in the expression, but a particle shape node is not one of the Selected Objects in the Expression Editor. A particle shape node must be selected to use particle array attributes. A particle array attribute is also called a per particle attribute.
You tried to set the value of an attribute that has already been set by one of these techniques:
You used an object.attribute name that exists in two or more parent objects. Two objects in a scene can have the same object name if they have different parent objects.
For example, a scene might have a child of GroupA named Ball.tx and a different child of GroupB named Ball.tx. If you write a statement such as “Ball.tx = time;”, Maya won’t know which Ball.tx to set.
To eliminate the error in this example, you must enter the full pathname of the attribute as GroupA|Ball.tx. The pipe symbol (|) specifies that the object to its left is the parent of the object on the right.
You can read the value of the predefined time and frame variables, but you cannot set them.
You tried to set or read the value of an attribute that was a string or matrix type. For instance, you might have tried to use an attribute named translate rather than translateX, translateY, or translateZ attribute.
In the error message above, worldMatrix is an attribute that exists for transforms, but you can’t use it. It’s for Maya’s internal use.
You tried to divide by an attribute or variable that equals 0. This typically happens in an expression statement that divides by an object’s translateX, translateY, or translateZ attribute when the Snap to grids button is on and you drag the object to past the X-, Y- or Z-axis. When Snap to grids is on, the translateX, translateY, or translateZ attribute becomes exactly equal to 0 at the point where you drag the object across the axis.
To prevent this error, turn Snap to grids off. With snapping off, the attribute is unlikely to become exactly 0 as you drag across the axis.
It is safe to ignore the warning message when the -style flag is used for loading old Maya scene files. The warning message is a result of improving the functionality of the grid command. As a result the -st/style flag is obsolete. Saving and loading Maya 4.0 or later files will not generate this warning message.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License