What is MEL?
● Eveything you do in Maya with mouse clicks and keyboard
inputs is a MEL command.
● MEL is a scripting language, similar in syntax to C. It
contains not only a complete range of 3D operation
commands, but also a rich set of UI creation commands. In
fact, all of Maya's dialog windows are written with MEL.
● Typical uses:
❍ Repetitive task. Eg. renaming many objects.
❍ Expression aid. Eg. offset animation.
❍ Creating special Hypergraph nodes. Eg. time node.
❍ Custom UI (see the User Interface section).
❍ Some tasks can only be done through MEL. Eg.
● You would typically execute MEL commands and scripts
once-off. Although you can write dynamic MEL scripts, they
are usually very slow to execute.
MEL input methods
1. Type the following command into the command line at the
bottom of the Maya window:
polyCube -tx 0 -ch 0 -n cube1
and press Enter to execute the command.
2. Delete the cube and open the script editor (either through
Window ··> General Editors ··> Script Editor, or through
the Script Editor icon
located at the bottom right of the
The top area of the script editor is the history panel; it
echoes MEL commands that you've executed, and also
displays error messages. The bottom area is the input
panel; this is where you type MEL procedures. Take note
that the key pad Enter is for typing new line, while the
number pad Enter is for executing the script.
http://cade.scope.edu/courseware/notes/mel/index.html (1 sur 4)03/08/2004 14:33:34
Type the following lines in the input panel:
float $xpos, $zpos;
for( $count = 1; $count <= 50; $count++ )
$cubename = "cube" + $count;
$xpos = rand( -10, 10 );
$zpos = rand( -10, 10 );
polyCube -tx 0 -ch 0 -n $cubename;
move $xpos 0 $zpos;
and press the number pad Enter to execute the procedure;
you may also ex