2009

Table Of Contents
NOTE When saving a script, you must have the .mel extension appended
to the script file name in the Save Script dialogue box.
Using the saved script file
You can apply the makeRoll procedure to any geometry quickly by selecting
the object to apply makeRoll to, and executing the makeRoll_create_UI global
procedure. Before using a script in your scene, you must source it. Sourcing
executes all the commands within a script file.
You can only access global procedures declared in the script file from the Script
Editor. Any local procedures cannot be accessed from the Script Editor, and
must be called from global procedure within the script file.
NOTE Global procedures only have access to local procedures declared before
them in a script file.
To source and use a script file
1 Select File > Source Script
2 In the Source Script dialogue box that opens, select
makeRoll_create_UI.mel
3 Create geometry to test the makeRoll procedure on by creating a new
scene and typing the following:
polyPyramid;
4 Execute the makeRoll_create_UI global procedure to create the user
interface by typing the following in the Script Editor:
makeRoll_create_UI;
The user interface you created opens.
642 | Chapter 13 Scripting in Maya