Maya Embedded Language

Last updated

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.

Contents

Design

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

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

Example

This is an example of a script which copies a selected object through its path:

// animated duplicates/instances scriptprocanimatedDuplication(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 startstring$selectedObjects[];// to store selected objects$selectedObjects=`ls -sl`;// store selected objectsselect$selectedObjects;while($i<=$num_of_duplicates){$temp=$range_start+($step_size*$i);currentTime($temp);// selected the objects to duplicate or instanceselect$selectedObjects;if($duplicateOrInstance==0){duplicate;}else{instance;}$i++;}}// Usage example://  duplicate the current selection 5 times --//  evenly distributed between frame 1 and 240animatedDuplication(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.

Related Research Articles

<span class="mw-page-title-main">JavaScript</span> High-level programming language

JavaScript, often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, often incorporating third-party libraries. All major web browsers have a dedicated JavaScript engine to execute the code on users' devices.

OCaml is a general-purpose, high-level multi-paradigm programming language which extends the Caml dialect of ML with object-oriented features. OCaml was created in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez, and others.

<span class="mw-page-title-main">Autodesk Maya</span> 3D computer graphics software

Autodesk Maya, commonly shortened to just Maya, is a 3D computer graphics application that runs on Windows, macOS and Linux, originally developed by Alias and currently owned and developed by Autodesk. It is used to create assets for interactive 3D applications, animated films, TV series, and visual effects.

Autodesk 3ds Max, formerly 3D Studio and 3D Studio Max, is a professional 3D computer graphics program for making 3D animations, models, games and images. It is developed and produced by Autodesk Media and Entertainment. It has modeling capabilities and a flexible plugin architecture and must be used on the Microsoft Windows platform. It is frequently used by video game developers, many TV commercial studios, and architectural visualization studios. It is also used for movie effects and movie pre-visualization. 3ds Max features shaders, dynamic simulation, particle systems, radiosity, normal map creation and rendering, global illumination, a customizable user interface, and its own scripting language.

<span class="mw-page-title-main">LightWave 3D</span> 3D computer graphics program

LightWave 3D is a 3D computer graphics program developed by NewTek. It has been used in films, television, motion graphics, digital matte painting, visual effects, video game development, product design, architectural visualizations, virtual production, music videos, pre-visualizations and advertising.

<span class="mw-page-title-main">ActionScript</span> Object-oriented programming language created for the Flash multimedia platform

ActionScript is an object-oriented programming language originally developed by Macromedia Inc.. It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript, though it originally arose as a sibling, both being influenced by HyperTalk. ActionScript code is usually converted to byte-code format by the compiler.

In some programming languages, eval, short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval. The input to eval is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree, or of special type such as code. The analog for a statement is exec, which executes a string as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either eval or exec is.

In computer programming, a callback or callback function is any reference to executable code that is passed as an argument to another piece of code; that code is expected to call back (execute) the callback function as part of its job. This execution may be immediate as in a synchronous callback, or it might happen at a later point in time as in an asynchronous callback. Programming languages support callbacks in different ways, often implementing them with subroutines, lambda expressions, blocks, or function pointers.

<span class="mw-page-title-main">Houdini (software)</span> 3D animation software

Houdini is a 3D animation software application developed by Toronto-based SideFX, who adapted it from the PRISMS suite of procedural generation software tools. The procedural tools are used to produce different effects such as complex reflections, animations and particles system. Some of its procedural features have been in existence since 1987.

Windows Presentation Foundation (WPF) is a free and open-source graphical subsystem originally developed by Microsoft for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0 in 2006. WPF uses DirectX and attempts to provide a consistent programming model for building applications. It separates the user interface from business logic, and resembles similar XML-oriented object models, such as those implemented in XUL and SVG.

<span class="mw-page-title-main">Autodesk Softimage</span> Discontinued 3D graphics software

Autodesk Softimage, or simply Softimage was a 3D computer graphics application, for producing 3D computer graphics, 3D modeling, and computer animation. Now owned by Autodesk and formerly titled Softimage|XSI, the software has been predominantly used in the film, video game, and advertising industries for creating computer generated characters, objects, and environments.

The Advanced Visualizer (TAV), a 3D graphics software package, was the flagship product of Wavefront Technologies from the 1980s until the 1990s.

<span class="mw-page-title-main">C Sharp (programming language)</span> Multi-paradigm (object-oriented) programming language

C# is a general-purpose high-level programming language supporting multiple paradigms. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

<span class="mw-page-title-main">Event Viewer</span> Component of Microsofts Windows NT operating system

Event Viewer is a component of Microsoft's Windows NT operating system that lets administrators and users view the event logs on a local or remote machine. Applications and operating-system components can use this centralized log service to report events that have taken place, such as a failure to start a component or to complete an action. In Windows Vista, Microsoft overhauled the event system.

iClone is a real-time 3D animation and rendering software program. Real-time playback is enabled by using a 3D videogame engine for instant on-screen rendering.

In computer programming, the async/await pattern is a syntactic feature of many programming languages that allows an asynchronous, non-blocking function to be structured in a way similar to an ordinary synchronous function. It is semantically related to the concept of a coroutine and is often implemented using similar techniques, and is primarily intended to provide opportunities for the program to execute other code while waiting for a long-running, asynchronous task to complete, usually represented by promises or similar data structures. The feature is found in C# 5.0, C++20, Python 3.5, F#, Hack, Julia, Dart, Kotlin 1.1, Rust 1.39, Nim 0.9.4, JavaScript ES2017, Swift 5.5 and Zig, with some experimental work in extensions, beta versions, and particular implementations of Scala.

<span class="mw-page-title-main">Parametric design</span> Engineering design method

Parametric design is a design method where features are shaped according to algorithmic processes, in contrast to being designed directly. In this method, parameters and rules determine the relationship between design intent and design response. The term parametric refers to input parameters fed into the algorithms.

<span class="mw-page-title-main">Art of Illusion</span>

Art of Illusion is a free software, and open source software package for making 3D graphics.

References