Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Design  





2 Uses  





3 Example  





4 Features  





5 References  





6 External links  














Maya Embedded Language






Español
Français
Հայերեն
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


The Maya Embedded Language (MEL) is a scripting language used to simplify tasks in the 3D graphics software Autodesk 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.

Design[edit]

MEL is syntactically similar to Perl and Tcl. 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 primarily a language meant to journal the Maya session,[citation needed] so it lacks many advanced features such as associative arrays. Python was added to Maya as an alternative to MEL in Maya 8.5. Still MEL offers some advantages to Python:

MEL is often criticized for its lack of programming features, and object orientation. In practice, however, MEL is used as a metaprogramming 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[edit]

The tools designed using MEL scripts generally come under the following categories:

Example[edit]

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);
        // selected 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);

Features[edit]

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[edit]

  • Mark R. Wilkins, Chris Kazmier: "MEL Scripting for Maya Animators". 2nd edition, Morgan Kaufmann 2005; ISBN 0-12-088793-2
  • Pisca, Nicholas, "YSYT - Maya MEL Basics for Designers". 1st edition, 0001d Publishing 2009; ISBN 978-0-578-00988-9
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Maya_Embedded_Language&oldid=1144447791"

    Category: 
    Scripting languages
    Hidden categories: 
    Articles lacking in-text citations from July 2014
    All articles lacking in-text citations
    All articles with unsourced statements
    Articles with unsourced statements from October 2019
     



    This page was last edited on 13 March 2023, at 20:35 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki