HOME

TheInfoList



OR:

The Maya Embedded Language (MEL) is a
scripting language A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled. A scripting ...
used to simplify tasks in Autodesk's 3D Graphics Software ''Maya''. Most tasks that can be achieved through Maya's
GUI The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
can be achieved with MEL, as well as certain tasks that are not available from the GUI. MEL offers a method of speeding up complicated or repetitive tasks, as well as allowing users to redistribute a specific set of commands to others that may find it useful.


Design

MEL is syntactically similar to
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
and
Tcl TCL or Tcl or TCLs may refer to: Business * TCL Technology, a Chinese consumer electronics and appliance company **TCL Electronics, a subsidiary of TCL Technology * Texas Collegiate League, a collegiate baseball league * Trade Centre Limited ...
. It provides some memory management and dynamic array-allocation, and offers direct access to functions specific to Maya. The majority of standard Maya commands are default MEL scripts, saved in the Maya Program Files directory. MEL is fairly limited compared to mainstream scripting languages. Mel is primarily a language meant to journal the Maya session , thus lacks many advanced features such as associative arrays.
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
was added to Maya as an alternative to MEL in Maya 8.5. Still MEL offers some advantages to Python: * Discoverability of MEL is better since the built-in command echo server was created with MEL in mind. * A lot of legacy code and inner working of Maya is in MEL form. This provides many insights into undocumented inner workings of Maya. MEL is often criticized for its lack of programming features, and object orientation. In practice, however, MEL is used as a
metaprogramming Metaprogramming is a programming technique in which computer programs have the ability to treat other programs as their data. It means that a program can be designed to read, generate, analyze or transform other programs, and even modify itself ...
language where MEL just instructs Maya's node architecture to solve the problem. Since nodes form the actual computational core of Maya using a more robust readily apparent programming method would be a very inefficient approach. In many ways MEL complements the Maya API, with somewhat clear boundaries between allocated tasks. This makes MEL harder to learn and fully understand.


Uses

The tools designed using MEL scripts generally come under the following categories: *Data I/O *Motion capture data import *Proprietary game data export *Scene meta-data for production tracking *Geometry creation/modification *Custom primitives *Third-party renderer specific data type (e.g., RenderMan sub-divisional surfaces) *Modeling tools not offered in the base package *Animation tools *Muscle simulators *Rigging/setup controls *Crowd AI behavior *Lighting /rendering tools *Automatic creation of common complex shader setups *Pre- and post-render effects *Making calls to third-party renderers *Dynamics *Custom particle behavior *Simulated object emergent flocking and swarming *Genetic algorithms *Cloth simulation *File and folder scene setup and maintenance *User interface customization *Custom character controls *Removal of invalid Maya commands *Custom UIs


Example

This is an example of a script which copies a selected object through its path: // animated duplicates/instances script proc animatedDuplication (int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance) // Usage example: // duplicate the current selection 5 times -- // evenly distributed between frame 1 and 240 animatedDuplication(1, 240, 5, 0);


Features

Maya also offers an expression language that is a super-set of MEL, and results in nodes that are executed as part of Maya's dependency graph. Expressions are developed with Maya's expression editor, and allow scripts to trigger while Maya evaluates the scene file at each change in time, to simulate complex behaviors or perform other useful tasks.


References

* Mark R. Wilkins, Chris Kazmier: " MEL Scripting for Maya Animators". 2nd edition, Morgan Kaufmann 2005; * Pisca, Nicholas, " YSYT - Maya MEL Basics for Designers". 1st edition, 0001d Publishing 2009;


External links

* {{official_website, http://www.autodesk.com/products/autodesk-maya/overview
MEL command reference (Maya 2013)





MEL and Expressions - Autodesk Maya 2015 Help

Mel Wiki

Useful Scripts for Maya

CGSociety - Maya Programming forum

CGSociety - 'MEL scripts' thread

CGSociety - 'Maya UI Building' thread

MEL Scripting Tutorials for Maya - CreativeCrash



MEL video tutorials - lynda.com

Digital Tutors search - MEL



MEL - maya rigging wiki

Mel Scripting - RobTheBloke
Scripting languages