Friday, December 10, 2010

Scripting

In Maya, all attributes are parametric, meaning anything can be connected to anything (e.g. a color intensity of a shader can be used to control the movement of a door opening and closing). To control the node-based system of Maya, its fully reconfigurable user interface can be scripted with MEL script code which can be dropped onto a shelf to create a new icon that executes that code.
With the release of Maya 8.5 support for the Python scripting language been included. The current implementation of Python in Maya is not fully object oriented though.

MEL scripting

Maya has an embedded script language called MEL, Maya Embedded Language, which is similar to TCL and Perl programming. Code written in MEL can be executed from the script editor, shelves, and drop down menus.
MEL affords more access and control than what was designed in the User Interface; some functions of the software and advanced options are only available by using MEL programming. All Maya preferences, commands, toolbars, and drop down menus are MEL code. By recording from the Script Editor History Window or scanning the Maya Program Files directory, it is possible to retrieve the original MEL procedures and functions.
MEL is not object oriented, so it is impossible to create custom classes and methods as you would in C++ or Python. The advantage of this is that it gives MEL a strong structure making it accessible and easier to understand to Maya users and to first time programmers. Also the linear scripting nature of the language would assist the user in making the most of the Maya nodes instead of tempting him/her to make their own objects, as in case of object oriented languages.

No comments:

Post a Comment