Maya Embedded Language

Maya Embedded Language

The Maya Embedded Language (MEL) is a scripting language used to simplify tasks in Autodesk's 3D Graphics Software Maya. Most tasks that can be achieved through Maya's GUI 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.

MEL is syntactically similar to Tcl and Perl. 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. It is not object oriented, and lacks advanced features such as associative arrays. Very few improvements have been made to it in recent years, and in Maya 8.5, Python was added to Maya as an alternative to MEL.

Contents

Applications of MEL

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)
{
    int $range_start = $rangeStart;
    int $range_end = $rangeEnd;
    int $num_of_duplicates = $numOfDuplicates;
    int $step_size = ($range_end - $range_start) / $num_of_duplicates;
    int $i = 0;
    int $temp;

    currentTime $range_start;     // set to range start

    string $selectedObjects[];    // to store selected objects
    $selectedObjects = `ls -sl`;  // store selected objects
    select $selectedObjects;

    while ($i <= $num_of_duplicates)
    {
        $temp = $range_start + ($step_size * $i);
        currentTime ($temp);
        // seleced the objects to duplicate or instance
        select $selectedObjects;
        if($duplicateOrInstance == 0)
        {
            duplicate;
        }
        else
        {
            instance;
        }
        $i++;
    }
}
 // Usage example:
 //  duplicate the current selection 5 times -- 
 //  evenly distributed between frame 1 and 240
 animatedDuplication(1, 240, 5, 0);

Expression Language

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

See also

External links


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Maya script — Maya Type Logographic (used both logograms and syllabic characters) Languages Mayan languages Time period 3rd century BCE to …   Wikipedia

  • Maya — У этого термина существуют и другие значения, см. Майя. Maya Тип Редактор трёхмерной графики Разработчик Autodesk …   Википедия

  • Maya (Software) — Maya Entwickler Alias (Autodesk) Aktuelle Version 2012 (11. April 2011) …   Deutsch Wikipedia

  • Maya PLE — Maya Entwickler: Alias (Autodesk) Aktuelle Version: 2009 (10.0) (August 2008) Betriebssystem: Windows, Linux, Mac OS X …   Deutsch Wikipedia

  • Maya (programa) — Saltar a navegación, búsqueda Autodesk Maya Desarrollador Autodesk www.autodesk.com/maya Información general …   Wikipedia Español

  • Maya (software) — Infobox Software name = Maya caption = screenshot of Maya 2008 Unlimited running on Windows XP Professional developer = Alias Systems Corporation, now owned by Autodesk latest release version = 2009 (10.0) latest release date = October 06, 2008… …   Wikipedia

  • Maya language (disambiguation) — A Maya language is one of a group of languages spoken by the Maya peoples of Mesoamerica. Maya language may also refer to: Yucatec Maya language or Maya, a Mayan language spoken in the Yucatán Peninsula Badimaya language or Parti Maya, an… …   Wikipedia

  • Maya religion — Maya civiliza …   Wikipedia

  • language — /lang gwij/, n. 1. a body of words and the systems for their use common to a people who are of the same community or nation, the same geographical area, or the same cultural tradition: the two languages of Belgium; a Bantu language; the French… …   Universalium

  • Autodesk Maya — 2011 running on Windows 7 using realtime CGFX shaders …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”