2009

Table Of Contents
multiple copies of the same user interface could interfere with each other
or slow down Maya.
NOTE You can view the full name and path of a user interface elements by
using the print command to output the variable.
print $button_one;
The following is output to the Script Editor:
pick_me_window|columnLayout2|button1
This is the full path of the user interface control. You are using variables
to store the name and path of controls and therefore you do not have to
type the whole name and path to refer to user interface elements.
In this section, you learned how to create, delete, and check for the existence
of named windows. In the next section, youll hook up a more complex
window to a procedure.
Introduction to procedures
A procedure is a series of instructions that are separate from the main flow of
the script. Procedures allow you to reuse certain portions of a script for new
applications.
In this section, you use a procedure that is included with Maya (makeroll,
which simulates an object rolling on a plane). Later in the lesson, you link
this procedure to a user interface to provide an easier way to use the procedure.
To execute the makeRoll procedure
1 Create a cube and a ground plane by typing the following in a MEL tab
of the Script Editor:
polyCube -name roll_Cube; polyPlane -height 10 -width 10;
2 Execute the makeRoll procedure by typing the following in a MEL tab of
the Script Editor:
630 | Chapter 13 Scripting in Maya