2009

Table Of Contents
Some basic concepts
The following section introduces some basic concepts that help you understand
whats going on when you use scripting in Maya.
The command architecture
Maya has a command-based architecture for handling all of its operations.
The commands for all of Mayas functionality are accessed through scripting
language commands tied to the Maya user interfacemenus, tools, dialog
boxes; in fact, just about anything you interact with in Maya. As well, you
can explicitly enter Maya commands in the scripting languages that Maya
supports.
Every Maya command has multiple arguments that set the way in which the
command executes. Arguments and their implicit or explicit values are required
for a command to execute.
To set argument values, the scripting languages in Maya use flags. Flags tell
the scripting language which argument of the Maya command is set with
what value. The value that is assigned to the argument follows the flag.
Flags have short and long names in MEL and Python. Commands execute
identically whether or not you use the short or long name of the flag. Long
names are often descriptive and useful for new users; short names abbreviate
flag names for power users.
Scripting languages in Maya
Maya supports two scripting languages:
MEL (Maya Embedded Language) is a proprietary scripting language
modeled after Unix shell script.
Python is a recent addition to Maya that provides the same access to Mayas
commands as MEL. Python is a widely-used modern programming
language.
Mayas user interface is built using scripts that execute (call) Maya commands.
As Python is a recent addition to Maya, the majority of the scripts accessed
through the user interface are written in MEL.
For example, when you click the sphere icon on the Shelf or select an item
from a menu, Maya calls MEL commands to create a sphere or execute the
command associated with the menu item.
592 | Chapter 13 Scripting in Maya