Popular Posts

Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Tuesday, February 22, 2011

Basic Mel: Variables

Defining Variables

Knowing how to define variables is the first thing you should learn if you want to start Mel Scripting. It is very basic, but after awhile this becomes second nature. Here is an example of how you would define one:

string $variableName = "Toast";

(variable type)  $(variable name) = (value);

The variable type always comes first, followed by the variable name.
The variable name must always come after a dollar sign ($). This lets Maya know the name of the variable.
Finally the value is what that variable equals.
You must end each equation in maya with a semi-colon (;). This tells Maya that this is the end of that equation.