Version 1 of MEL

Updated 2004-01-06 18:24:47

GS - Maya Embeded Language (MEL) is a scripting and command language included in Maya [L1 ] (a powerful 3D animation and visual effects software). 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 10.0 -ssw 0 -esw 180 -n half_sphere;
 }

 proc QuitApplication()
 {
  deleteUI simpleGUI;
 }

Category Language