2010

Table Of Contents
Were using backticks for evaluation again here, though in this case, were
creating three variables ($button_one, $button_two, and $button_close)
that hold the results of calling the button command each time.
2 Press one of the Click Me! buttons in the window to test the script.
Clicking one of the Click Me! buttons deletes the other button by
calling the deleteUI command with the variable that stores the name of
the button control as an argument (button_one or button_two).
(If you click the button a second time, youll get an error as the button
youre trying to delete has already been deleted.)
3 Close the window by pressing the Close button in the window.
When you created your user interface window, you assigned it a unique
name manually. This is a good practice to ensure that you cannot open
multiple copies of a user interface. With more complicated user interfaces,
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.
Introduction to procedures | 689