• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint


You can access commands in Maya in lots of ways: through the Hotbox, main menus, contextual menus, hotkeys, shelves, and marking menus. This provides for a lot of overlapping methods for accessing commands, some of which are better than others for specific interactions.

In this section, we look at some of these methods and how to take advantage of their strengths for your work.

Command Defaults

As you set options for various commands (for example, tools or actions) with option boxes, Maya remembers the last values you specified and stores them in your userPrefs.mel file for use the next time you select that command. This is fine if you have a command with options that rarely change or that change almost every time you use it, but many commands have factory defaults that are not quite what you normally want or which are invoked with two or more typical sets of optional values. One thing that can help is to edit the factory default option settings.

In the $MAYA_LOCATION/scripts directory are two directories that contain the MEL command scripts: startup and others. In general, the user interface is created via the startup scripts, while the specific commands and their options are handled by the others scripts.


As you know, Maya can run on several operating systems. On each of these operating systems, Maya is installed in a different location, referred to by an environment variable known as $MAYA_LOCATION. Here's where each OS installs Maya by default:

Windowsdrive:\Program Files\AliasWavefront\Maya5.0
Mac OS XApplications\Maya5.0

Check the Essentials section of the User Guide in the Maya documentation for more information on this and other environment variables.


Although Windows systems use the backslash character (\) as a path delimiter, the other systems on which Maya runs (IRIX, Linux, and Mac OS X) use the forward slash character (/) instead. Except in the above explicit case, we adopt the forward slash as the delimiter in this book. If you're a Windows user, just use the backslash wherever you see a forward slash.

To change the behavior of any given script, copy the script from the Maya product directory to your own personal scripts directory. If the file is common to all versions of Maya that you might use, you can put it in ~/maya/scripts. Otherwise, put it in the version-specific script directory—for example, ~/maya/5.0/scripts.


The tilde character (~) is a standard UNIX-style abbreviation for the home directory. So, ~/maya is where one's Maya files usually reside, but ~maya would be the home directory of a user with a login of maya. We'll take advantage of this abbreviation occasionally for clarity.

So, what kinds of things might you want to change in these scripts? Well, for starters, a command's default option values won't necessarily match your working preferences. After all, maybe you like your primitives a different standard size or your attaches blended, not connected. No sweat.

Changing an Option Default

Let's say that you want to change the default behavior of the Attach Curve command so that Keep Originals is Off. To do this, first copy the performAttachCrv.mel script from the product's scripts/others directory to your local scripts directory and find the appropriate option section in a text editor. It looks like this:

// keep original (for in place operations is on-1 or off-0).
         if ($forceFactorySettings || !`optionVar -exists attachCrvKeepOriginal`)
                 optionVar -intValue attachCrvKeepOriginal 1;


The change is simple: Set the value to 0, like this:

optionVar -intValue attachCrvKeepOriginal 0;

When you save it and restart Maya, the Reset Options menu command now sets Keep Originals to Off, which saves you the trouble of turning it off each time.

But the really important lesson here is that Maya's “factory settings” are found in the various MEL command scripts, not hidden away in some undecipherable binary file somewhere. You are free to change them to suit your needs.

Solving Command Mysteries

In the simple case in the previous section, the name of the script was fairly obvious. Most of the modeling tools have a name like performWhatever.mel. And although in some cases a complex command might divide the work over a few scripts, you should generally be easily able to follow the optionVar settings back to the options you seek.

If it proves a bit tricky, set the ScriptEditor option Echo All Commands (in its Script menu) to see just what is being executed. You can solve many other mysteries by using the whatIs MEL command, as shown in Figure 4.1.

Figure 4.1. Examples of whatIs usage.

Sometimes the change is a little less obvious. You might need to do some spelunking through files or through the online MEL Command Reference to find the available choices of values. But with a little courage (or just the simple realization that you can go back to defaults by removing the edited file), you can safely change the defaults of almost any command.


You can remove any or all customizations to menu and interface files by simply removing the customized file(s) from your local scripts directories and restarting Maya.

If whatIs says that what you're inquiring about is just a command, you have two ways to get further information about that MEL command.

The first is to point your browser to the MEL Command Reference, which should have descriptions of all the MEL commands. Each command's flags and context are described, with usage examples often provided as well. Related commands are also usually listed at the bottom of the page.

In truth, however, sometimes there are MEL commands that aren't in the MEL Command Reference. For that, use the help command in the Script Editor, which is as easy as typing in help followed by the name of the command, as in help getAttr. This produces a quick listing of the command's available flags in the Script Editor and is called, appropriately enough, quick help.

Other options are also available with the help command (see help help). You can search for relevant commands with pattern matching; for example, help –list "*ebuild*" identifies commands likely related to rebuilding. Also, the display of annotation strings on the help line is set with the –rm option and as pop-ups (on the shelf, tool box, and status line) with the –pm and –pdt options.

Keeping It Under Control

You can alter other command behaviors as well. Besides option defaults, you can change things such as slider ranges (look for the floatSliderGrp command), option labels, help line prompts, and even error messages.

After a while, making command script changes like these can even become habit forming—all you'll want is just one more fix to make you feel better. The more you do it, the easier it is to do it again. And again.

But be careful: Edit MEL command scripts somewhat sparingly, if only to keep your ongoing personal maintenance effort to a minimum. After all, with each new version of Maya, you'll need to go back through each of these files (assuming that they haven't changed identities!) and reincorporate your edits into any scripts that have changed between versions.

When versions change, I find that I need to actually block out hours at a time to systematically compare, edit, and test these scripts. After a few such sessions, I'm back up to speed and refamiliarized with the sorts of things I've changed and why.

In my scripts directory, I have about 30 Maya scripts that I've modified in some way to improve their options or organization. In hindsight, I wish I had changed more of them sooner—they've each made my ride on Maya a bit smoother. As my experience with Maya grows, I'm sure I'll change several more—just as soon as they find their way onto my radar.


Put distinctive comments (or actual documentation) in your edited command scripts to let you know which parts of these files were edited. When you get the next Maya release, you can then more easily migrate the changes forward. And if you share your scripts, others will better understand your changes.

Because so many of these changes are quite easy, keep in mind that much of Maya's behavior is right there in your hands, ready to be remade in your own image. Because it can be done incrementally and easily, editing command scripts is worth routinely doing. Even as you identify nagging problems, you'll know that a few simple edits can make them go away.

You'll gradually reach the right balance—when the annoyance of the remaining problems is less than the effort required to repair them. Fortunately, as your experience at this grows, this effort lessens and Maya becomes increasingly effective for you.


Another exceptionally helpful way to speed up your work is to define and use personal hotkeys. Although Maya ships with many hotkeys already created for you, they're not likely to be specific to the tasks you yourself regularly perform.

The default Maya set is useful enough but is certainly not geared, for instance, toward modeling. So, by evaluating your frequent modeling needs, you can smooth the bumps in the modeling process with well-chosen hotkeys.

You might want a hotkey that executes a command with specific options, the last options used, or no options at all. Any of these can be accommodated, as can wholly new commands of your own.

For instance, if you tire of opening the Duplicate option box each time you need a simple copy (to make sure it's set to default values), make a hotkey for a vanilla duplicate command. It must be a separate command because hotkeys of menu commands will just execute those commands with whatever option settings were last used. After all, you probably won't want to worry that you might get a dozen rotated instances sometimes and one plain old copy at others, depending on the last options you've set.

In this case, it's a snap. The Duplicate menu command calls the MEL duplicate command, with options as indicated by their option box settings. A plain duplication operation turns out to just be a call to duplicate with no options.

Making It Memorable

Use the Hotkey Editor to create hotkeys that you'll remember. The hotkey that you can't remember might as well not exist.

First, review the default set provided with Maya. It's defined in the Maya product's scripts/startup/hotkeySetup.mel file, but the best way to review the defaults is to study the Quick Reference card that came with Maya.


Don't edit the hotkeySetup.mel file! Any hotkeys that you change via the Hotkey Editor will go in your userHotkeys.mel file. These will automatically override the defaults that hotkeySetup.mel creates, but allow defaults to be restored by deleting your hotkey.

Sometimes using other applications will set your expectations and associations for your hotkeys.

Because I used Alias AutoStudio for many years, I tried to make my transition to Maya relatively painless by carrying forward as many hotkeys as were useful. Wherever possible, I tried to assign the same hotkeys in both applications, taking the best from both and molding them into a powerful and efficient common shorthand.

I didn't use single-key hotkeys in AutoStudio, so since the Maya defaults make extensive use of unmodified keys, so my transition was easy. I used the modifier keys—Alt, Ctrl, and Shift—as the basis for creating hotkey categories and used similar modifiers for similar commands, all while striving to find associations that I would remember.

I thus associate, for instance, Alt+d with Duplicate and Alt+s with Save File As, for both historical and mnemonic reasons.

As another example, I've assigned camera commands to Ctrl+Shift hotkeys, which are very easy to select with most keyboards. I also strived to make those hotkeys easy to reach: Ctrl+Shift+z is zoom (one of my most commonly used hotkeys), Ctrl+Shift+d is dolly (I didn't like holding down two mouse buttons at once), Ctrl+Shift+x is track, and Ctrl+Shift+c sets my clipping planes automatically (it calls viewClipPlane –acp).

For that vanilla duplicate command, I made Alt+Shift+d the hotkey. The Shift key suggests to me an uber-application of the Alt+d duplicate that I've grown to know and love in AutoStudio. I've also used the Shift key in similar ways for other hotkeys, such as for opening command option dialog boxes.


Opening the option dialog box for a command is distinct from executing the command. You can assign hotkeys to either or both. If you often need to set a command's options, consider assigning a hotkey to the dialog box.

Each hotkeyed command fights for a place in your memory and at the keyboard. Multiple mnemonics are better than single ones. It's easier to remember my toggle Camera hotkey because my camera commands usually start with Ctrl+Shift and because I can think “Kamera” easily enough.

Whatever your conventions are, just having conventions makes it easier to remember your hotkeys, which increases their effectiveness.

Whatever mnemonics work for you, figure them out for those operations you do a lot. However useful you might find the Hotbox or marking menus, hotkeys are like registers in a CPU—use them for the things you access most often for best performance.


Don't make destructive hotkeys easy to select, especially those that write files. You can't undo an overwritten file! I have no hotkey for Save (vs. Save As) for this reason. And while I've set up a Delete All Geometry command, its hotkey uses the entire Ctrl+Alt+Shift modifier sequence, just to avoid accidents.

Mark's Hotkey Hall of Fame

Sure, we'll tell you to do things your way, but sometimes we really love it our way. So, rather than bite my lip completely, let me offer up a few personal favorites from my Hotkey Hall of Fame:

MergeVerticesAlt+'Key looks like two points merging into one.
SplitPolygonAlt+// is a division sign.
DeleteEdgeAlt+-- means deletion.
AppendToPolygonAlt+=Above the = sign is the + sign.
DetachCurveAlt+5% looks like a detach operation.
CollapseEdgeAlt+yY looks like the collapse operation.
InsertKnotAlt+6^ looks like a proofreader's insert.
DeleteHistoryAlt+HH stands for “history,” of course.
RevolveCtrl+0The 0 depicts the circular result.
ExtrudeCtrl+6The 6 looks like an extruded tube operation.

As you can see, many of my mnemonics are visual ones, taking their cues from the graphics on the keys. I think of graphical operations in visual terms, so this is a natural extension of my thought process.

Although less exciting (you are excited, right?), I have defined many other hotkeys that simply use a principal letter of the key command element, such as Alt+F for ConvertSelectionToFaces and Ctrl+F for picking poly faces. This consistency between hotkeys reinforces the mnemonics and keeps things orderly.

It can also be helpful to create a reference for yourself that you can review occasionally to refresh your memory. One easy way to create such a reference list is to combine your personal hotkeys (found in your prefs/userHotkeys.mel file) with the default hotkeys (found, as mentioned previously, in $MAYA_LOCATION/scripts/startup/hotkeySetup.mel), and then sort and edit the list a bit. If you do this, don't forget to remove or make obvious the defaults you've overridden. For even easier reference, you might want to group them by function so that your system becomes clear.


You know the “sacred” keys (QWERTY), right? Well, you can change those, too, if you want. I did—since R just had to be rotate, and W seemed like a scale factor to me. Call me stubborn. The mnemonics were just so much better for me that I had to do it (knowing full well that no one else would understand). Just in case you're similarly stubborn, don't forget to switch the modified QWERTY keys, too.

So, is anything out of bounds for hotkeys? Yes—modifier keys (Alt, Ctrl, and Shift) can't be used all by themselves as hotkeys. Otherwise, it's pretty much up to you.

Planning for the Future

You can assign hotkeys to existing commands or to new commands that you specify. If you're concerned about portability between users, machines, or new versions of Maya, you need to know that these situations are different.

If you're simply assigning hotkeys to existing Maya commands, it's easy. The Hotkey Editor records your new hotkey definitions in your maya/prefs/userHotkeys.mel file when you select Save. To then move your hotkey definitions to another machine or give them to another user, the userHotkeys.mel file is all that's required.


If you'd like a hotkey only for the duration of your Maya session, set up the hotkey in the Hotkey Editor and then choose Close—but without ever choosing Save. The hotkey definition will then be forgotten the next time you start Maya. This can be handy if you need to execute one or more MEL commands repeatedly and you'd like to make it easy to do each time.

On the other hand, if you're creating a hotkey for something new, you should try to make it as portable as possible.

The first step, of course, is to click the New button at the bottom of the Hotkey Editor dialog box (see Figure 4.2), which is accessed via Window, Settings/Preferences, Hotkeys. This activates the fields at the bottom, which enable you to create a new command for hotkey assignment.

Figure 4.2. Creating a new hotkey in the Hotkey Editor.

A hotkey assignment isn't made directly to the command string that you provide, but rather to a “named command.” These named commands are constructed for you automatically when you create a new hotkey, and they are stored in your maya/prefs/userNamedCommands.mel file. They appear in the User section of your hotkey categories.

If you just enter raw MEL, the named command will reference that MEL (via yet another file, userRunTimeCommands.mel). Unfortunately, if you want to provide that command to another user, you'll have to either point him to all of the right MEL files, or he'll need to enter the MEL code directly in his Hotkey Editor. Because users generally construct hotkeys to suit themselves, adopting your new and useful hotkeys will probably thus require that the person then hand-edit the desired entries into his own userNamedCommands.mel and userRunTimeCommands.mel files (rather than overwriting the existing files), which is both tedious and error-prone.

A better solution is to create each of your new commands for hotkeys in its own MEL script and then put each script in an accessible scripts directory. This allows the new hotkey to be defined simply by referring to the procedure in the script.

For example, the following simple toggle might be used to turn on or off the display of all lights in a view:

global proc toggleLights()
string $thisPanel = `getPanel -wf`;
modelEditor -e -lights (!`modelEditor -q -lights $thisPanel`) $thisPanel;

The script first identifies the view and then toggles the view state to display lights the opposite way that it had been doing. By the way, this framework can also be generally used to toggle any of the view's display categories found on its Show menu.

Another user could then use the command by simply putting it in a shared location in his $MAYA_SCRIPT_PATH and defining a hotkey that calls the toggleLights procedure, as shown in Figure 4.3. The procedure was written first, and then a new hotkey command that referenced the procedure was created in the Hotkey Editor. As a useful mnemonic, Ctrl+l (that's the lowercase letter L) was assigned as the hotkey.

Figure 4.3. A simple procedure call as a hotkey

If you define your hotkeys this way, different users can then set whatever hotkeys they like, without needing to concern themselves with your userNamedCommands.mel file. In addition, you will be able to reference the procedure in other ways (such as through marking menus), without needing to dig through the userNamedCommands.mel file for the necessary code..


A procedure is normally remembered only within the scope in which it is defined. After its enclosing scope is completed, the procedure is forgotten and its memory is returned for reuse. However, a proc that will be used repeatedly (as with a hotkey) should be retained in memory. So, by defining a procedure as a global proc, it will be remembered for use in whatever context it's called.

In short, if your hotkey's code might be useful to others or useful in other contexts, put it in a separate MEL file as a global proc.

Of course, we three authors have been working on this project in separate locations and performing separate tasks, so there is little need to coordinate our hotkeys. On the other hand, in our professional work outside of this project, these principles have proven quite valuable.

Assign your hotkeys with some care (remember, the hotkey that you can't recall is useless), but be sure to use them. The total time spent navigating menus in Maya can become enormous—as can the time saved by using hotkeys.


Of course, Maya also provides a place for putting commands that you need to access regularly—shelves. Shelves are terrific for collecting all the tools necessary for a common task. Marking menus, discussed in the next section, are also considered a kind of shelf.

I've created shelves for working on polysets, picking objects, doing NURBS surfacing, setting grids, and handling several other categories. Just the act of creating shelf categories will get your gears turning about your work process and help streamline your workflow.

An effective set of shelves offers one- or two-click access to almost all the commands you use regularly. When you're working with polygon meshes, for instance, you can leave a polygon tool shelf open that has a collection of the polygon tools that you use the most. When used in combination with a set of hotkeys, you might find that you hardly ever have to select your way through a menu. Even if you need some other nonpolygonal tool (such as Create Lattice, say), you can have it waiting on another shelf just a click away.

The command navigation strategies that you use are up to you, of course, but shelves enable you to place a convenient collection of the tools you need right next to your camera window.

Command Options and Shelves

A typical way to put a tool or action onto a shelf is to drag it there from a menu while holding down the appropriate modifier keys (Ctrl+Alt+Shift for IRIX, Alt+Shift for Linux, Ctrl+Shift for Windows, and Option+RMB on a Mac). This allows any item from the menus to be placed onto a shelf. If the item is a tool, it makes that item essentially a pointer to the menu item itself.


Maya distinguishes “tools” from “actions.” Tools are commands that require further user input (such as selecting geometry), while actions are performed with no further input required. Instead of constantly saying “tool or action,” I'll often just say “command” or “item,” unless an important distinction needs to be made.

However, if you want the settings for an item on your shelf to be unique from the menu settings, you'll probably want to put the item on the shelf by dragging its icon from the tool box with the middle mouse button. It will initially inherit the currently active settings, but these settings can be changed at any time using the Tool Settings window. You can thus put two CV Curve tools right next to each other, one making cubic curves and the other making linear curves.

What about commands (like actions) that don't have tool box icons? The Tool Settings window blithely says that selected tools (such as our friend Duplicate) have no options!

Say that you want unique instances of an action, such as creating separate MirrorX, MirrorY, and MirrorZ shelf items from the Duplicate command. Open the Shelf Editor and you'll see that a Duplicate command dropped onto your shelf actually executes a procedure called duplicatePreset with a slew of cryptic arguments. To better understand these arguments, you can use whatIs to identify the source of the proc and examine it in a text editor. However, because each of these is based on your option choices, you can simply set the options and drag each variation to your shelf.


Use the MEL whatIs command on the command line or in the Script Editor to find the source of a given MEL command or procedure. Often it's a quick way to track down MEL procedures that you'd like to tailor to better serve your needs. Of course, not everything is a MEL procedure. When whatIs says you've reached a Command, you've reached a basic MEL command and a solid binary barrier to tinkering.

Don't forget, of course, to provide some identifying text for each command variant on your shelves. For most shelf items, this is a trivial matter of using the Shelf Editor to specify label text and perhaps an icon name. However, some items (typically those implemented with the MEL superCtx command) stubbornly resist any attempt to set their labels.

If the shelf item is written out to the shelf file as a shelfButton (most are), you can also modify the item's prompt using the –annotation argument. There's no interactive way to modify the prompt, but a text editor can easily modify the annotation string in the shelf file. Thus, our MirrorX command can have a help line message other than the default Duplicate prompt, as shown in Figure 4.4.

Figure 4.4. A customized shelf set.

One other useful thing about editing the shelf file directly (in this case, the file shelf_Common.mel) is that special characters that are rejected interactively can actually be included in labels and messages. So, even though the Shelf Editor rejects attempts to label the icons –X and 1:1, this is easily done in a text editor.


Your shelf files are kept in your maya/5.0/prefs/shelves directory, each with a name such as shelf_SomeName.mel.

You can also assign MEL commands and scripts to shelf buttons (just drag the MEL onto the shelf from the Script Editor or the command line). Of course, as with hotkeys, it's much more portable to put the MEL into a script and then assign the script to the button.

Text-Mode Shelves

So, whatever you drag onto a shelf, you can edit any of the associated text fields and even edit the icon. But, wait, there's more! Or is it less?

Maya's shelves were initially designed with one more mode in mind: textOnly (see Figure 4.5). It turns out that, although textOnly doesn't appear on any menus, you can still easily hack the mode back in by editing just a couple of files. For your convenience, we've put the edited files (shelfEditorDialog.mel and shelfStyle.mel) on the included disk. Put them in your 5.0/scripts directory and restart Maya, and they add back in the handling of the textOnly mode.

Figure 4.5. Text-only shelves.

So, if you're like me and think that there are far more commands than meaningful icons, you can use the power of English (or whatever your language might be) to easily distinguish, say, your four-span 180° Revolve around Z from your eight-span 360° Revolve around X.

Then again, if you prefer icons and don't mind using labels and icon names and perhaps drawing your own custom icons to sort out your shelf commands, there's no reason to change. To be consistent with the way most users work, I've bitten the bullet on this issue and avoided using text shelves in most illustrations—but I continue to use text shelves when no one's looking.

Marking Menus

Although I don't normally use the Hotbox, I do use its marking menu feature. Marking menus are a very powerful concept, and Maya offers a host of ways to access them, the most obvious of which is via holding down the spacebar.

Dissin' the Hotbox

I find the Hotbox redundant (because it contains menus found elsewhere) and a bit overwhelming, so I don't use it—at least, not for getting at the main menu content. The menu commands that I use often find their way onto my shelves and into my hotkeys. Although I have little patience for traversing long menus, when I have to do it, I'd rather have fixed locations to navigate (the main menus) than a mass of commands opening wherever my cursor resides. Besides, I thought that the spacebar, also being used for marking menus and popping windows, already had enough to do.

When using the Hotbox marking menus, I use the Center Zone Only mode, which lets me set up a marking menu for each mouse button (a la AutoStudio). Although there are potentially 15 distinct marking menus (3 mouse buttons and 5 zones) that can be accessed via the spacebar, a zoneless configuration works well for me.

Why not use all zones? I find that I too often inadvertently select a command from, say, the North zone when I'm meaning to just make a North selection from the Center zone marking menu. I've settled for fewer marking menus so that I can eliminate command-selection errors. Besides, I don't really need the extra dozen marking menus.

Given my other use of hotkeys and shelves, the Hotbox marking menus are reserved for the really common operations, those done often enough that an associated gesture will become automatic after a short time.

To satisfy the rational side of my brain, I've given each marking menu a distinct purpose. My left marking menu is for picking, my center marking menu is for transformations, and my right marking menu is for camera manipulation.

To please the visual side of my brain and reinforce muscle memory (the key ingredient to the power of marking menus), things that “undo” on each marking menu are all to the North, common things are on the main compass points, and so on.

I've remade the marking menus to suit my working style, but doing so required determining the MEL needed to set up pick masks and selection modes and to invoke the select command. Now, thanks to well-planned picking commands on my marking menus (and a Pick shelf to handle the uncommon cases), I almost never have to visit the selection masks to get just what I want selected.


Not only are there modes for Hierarchy, Objects, and Components, but there's also a Mixed mode. Here's how a marking menu command for selecting surfaces in Mixed mode (so that you can have objects from other modes simultaneously selected) might look:

selectMode –p; selectType –ns 1; setToolTo $gSelect

The end result of all this tailoring of command selection methods has been to shape Maya's tools to my thought process, choosing the methods that resonate with me. Your choices could well be different, but the capability to make these changes allows Maya users to realize tremendous performance gains. It's a tribute to Maya's design that all of this can be done to suit almost any user's preferences, without changing the underlying product in any real way.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint