Maya Embedded Language

From Wikipedia, the free encyclopedia

The Maya Embedded Language is a scripting language used to simplify tasks in Alias' 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 repetetitive tasks, as well as allowing users to redistribute a specific set of commands with others that may find it useful.

MEL is syntactically similar to Perl. It provides some memory management and dynamic array-allocation, and offers direct access to functions specific to Maya. This is an example of a script which copies a selected object through its path:

 // animated duplicate/instance 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);

Maya also offers an expression language that is a superset 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 act while Maya evaluates the scene file, to simulate complex behaviors or perform other useful tasks.


Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.