MEL

Maya Embeded Language , or MEL, is a scripting and command language included in Maya , a powerful 3D animation and visual effects program. MEL can access to the Maya software features and allows to develop GUI and custom applications (modeling, animation, dynamics or rendering tasks).

MEL has some syntax similarities with Tcl-Tk (command + arg1 + arg2 + ....) and is easily understandable by a Tcler.

For example, to create an half-sphere:

sphere -r 10.0 -ssw 0 -esw 180 -n half_sphere;

And a simple GUI with menu and buttons for creating an half-sphere:

http://gersoo.free.fr/wiki/w10636/mel.jpg

// Simple GUI with a button for creating an half-sphere

if ("window -exists simpleGUI") deleteUI simpleGUI;

window -menuBar true -widthHeight 200 60 -title "A simple GUI" simpleGUI;
menu -label "File" -tearOff true;
     menuItem -label "Open";
     menuItem -label "Save";
     menuItem -divider true;
     menuItem -label "Quit" -command "QuitApplication";
menu -label "Help" -helpMenu true;
     menuItem -label "Content";
     menuItem -label "About"; 
columnLayout; 
button -label "Hello" -width 44 -command "PrintHello" Button_1;
button -label "Sphere" -width 44 -command "CreateSphere" Button_2;
button -label "Quit" -width 44 -command "Quit" Button_3;
showWindow simpleGUI;

proc PrintHello()
{
 print "Hello\n";
}

proc CreateSphere()
{ sphere -r 60.0 -ssw 0 -esw 180 -n half_sphere;
}

proc QuitApplication()
{
 deleteUI simpleGUI;
}

I never understood why people keep inventing their own script languages for embedding in software. I can't see any reason why they didn't just use Tcl... -Setok

GS 2009-01-16: It's an historical reason. Behind Maya there is two software: Wavefront and Alias Power Animator. When they were purchased by SGI in 1995, it was decided to merge them into a new software (Maya). The first version of Maya used Tcl, but there was a debate between 3 scripting languages: Tcl, Perl or Sophia (an in-house language). Finaly the winner was Sophia, renamed MEL (Maya Embedded Language) and influenced by Tcl.

It is always possible to use Tcl with Maya by creating a socket and sending commands throught port 2222.

Page Authors

GS