Datasheet
5
Editor. To do this, highlight the shelf name in the Shelves
tab, select the icon name in the Shelf Contents tab, and
make your changes in the Edit Commands tab. If you want
to save your changes, press the keypad Enter key. To save all
the shelves, click the Save All Shelves button (this exits the
window).
You can customize the look of a shelf icon by entering
a name into the Icon Name field. The name is superim-
posed over the icon. You can also use your own custom
icon by clicking the Change Image button. Maya is able to
use a 32✕32 BMP, XPM, or DIB file. XPM is a somewhat
archaic ASCII image format supported by Maya and Silicon
Graphics machines. DIB (Device Independent Bitmap) is a
Windows variation of the standard BMP format. You can
store your icon files in the
icons folder found within the
program directory or the
prefs folder.
You can load a previously saved shelf by choosing Load Shelves from the Menu Of Items
To Modify The Shelf shortcut arrow to the left of the shelves.
a
Building a Simple MEL Window
One of the most satisfying elements of MEL scripting is the creation of custom windows, or GUIs.
If you’re relatively new to the world of scripting, however, the MEL code can be very intimidating.
With that in mind, this section boils down MEL windows into their most basic components.
The following MEL script makes a simple window with two drop-down menu options,
two buttons, and a short text message:
window -title “Simple Window” -menuBar true newWindow;
menu -label “Options”;
menuItem -label “Save File” -command “file -f -save”;
menuItem -label “Exit Maya” -command “quit”;
columnLayout;
button -label “Scale Up” -command “scale -r 2 2 2”;
button -label “Scale Down” -command “scale -r .5 .5 .5”;
text -label “Click me!”;
showWindow newWindow;
Building a Simple MEL Window
The Edit Commands tab of the
Shelf Editor window
“mel” and other custom icons on
a custom shelf. The custom icons
are included in the Chapter 1
images folder on the CD.
07405c01.indd 507405c01.indd 5 1/17/07 8:30:47 PM1/17/07 8:30:47 PM