

Along with the MEL command itself, other code lines may also appear so we will have to further investigate what we need to use from the History and what is unnecessary. While activating the function we need to save on the shelf, we need to watch the lines appearing in History. The Script Editor window should stay open until we add a new button to the custom shelf.Īnd here comes the action. When Script Editor is launched we need to enable “Echo All Commands” from the “History” menu in order to see all the commands in History (in some menus commands are not shown in History automatically without this option being enabled). Script Editor consists of two main windows – History (top) and Input (bottom). The first step is to understand what commands are executed when a certain Maya menu item is activated. It is not possible to list all the commands associated with menu items so this part of the article is not about giving you a ready-made product but rather showing how you may find commands you might need on your own and then save them as the buttons to your shelf.įor example, we need to create a button on the custom shelf which will turn on Multi-antialiasing and Smooth wireframe in the scene in one single click. In order to avoid that in the majority of cases you might save a MEL command called by the menu item as a button on your custom shelf. Repeating the menu sequence many times during a short period of time could become a hassle.
:max_bytes(150000):strip_icc()/MayaTrainingSeries_2.1.2-56aa96cf5f9b58b7d008c1cb.jpg)
Sometimes we need to use certain Maya functions located somewhere deep inside an entire maze of menus. mel at all times.Īnother Way of Adding New Shelf Functions txt extension to the file without even notifying you and the resulting file will be of no use. If you create this file in Windows Notepad make sure that “Save as type” is set to "All files". This file should go into the C:\Users\USERNAME\Documents\maya\MAYAVERSION\prefs\scripts directory, where USERNAME is your local account name and the MAYAVERSION is the Maya version you use. To override the default value on each Maya startup it is necessary to create (or, if you have got one already, to add a script to it) a file named 'l', which is a user script file for Maya, and then put the script in it. However, next time you launch Maya, the default value for the shelves panel height will be set. If you want to use an army of buttons and your screen size and resolution allow you to do that, it is possible to increase this size even further up to whatever value you might need. The value 97 provides the ability to use two rows of buttons without having to scroll at the cost of taking additional space above Maya’s Viewport window. The default value is 45 for one single row of buttons.

This line defines the height of the shelf panel in pixels. Here is an explanation of the script to help you fine-tune it for your needs. To increase the height of the shelf panel you may use the following script:
