Create Shelf Buttons / Hotkeys
¶
All tools are acompanied with instructions on how to setup and activate using the accompanied code in Maya.
To get the most out of these and boost your productivity, you will need to either create a shelf button or a hotkey in the hotkey editor in Maya.
Creating a Shelf Button¶
For this example we will use the Bevel mel code provided in the Free Tools section.
Info - Mel / Python source
The programming language will always be either Mel or Python. Please refer to each tool's page to tell you which which programming language to use during the installation process (refer to the installation page of each tool for detailed instructions).
1 2 3 | |
Copy these 3 lines of code and open Maya.
In Maya there's different ways to create a shelf button.
From the main viewport¶
Creating a shelf button using the Mel (or) Python execution of the command line source.
Info - Mel / Python source
You can switch between Mel and Python languages by clicking on the name.
Each tool's page will tell you which which programming language to use during the installation process (please refer to the installation page of each specific tool for detailed instructions).
Switching bewteen Maya/Python is not that necessary at this moment as Maya will prompt us to choose the language we want to use later.
Set the command line source is set to Mel (as that is the programming language used for this specific tool) and paste in the code.
From here select/highlight the code (Ctrl + a) then Middle Mouse drag the text on your shelf.
Once dragged a pop up window will appear 'Save script to shelf as type:' since our code is in mel select Mel.
Your Shelf button is now created and you can now activate the tool by clicking on the button.
Info - Command Line
If you are missing the command line at the bottom of Maya's interface, go to Windows UI Elements
and make sure Command Line checkbox is checked.
From the script editor¶
The process of creating a shelf buton from the script editor is quite the same as above.
- Open the script editor.
The script editor window should pop up.

- Right Click on the bottom half section of the script editor and create a new Mel tab.
Info - Python/Mel tabs
Each tool's page will tell you which which programming language to use during the installation process (please refer to the installation page of each specific tool for detailed instructions).
- Copy paste in the Mel script.
- Highlight/Select the text (Ctrl + a).
- Middle Mouse drag the text on your shelf.
Maya knows its a mel script and will create the shelf button for us.
Important - Close Maya to save Shelf Button
It's best to close and re-open Maya after making buttons or hotkeys because if Maya crashes, you will have to repeat the process all over again.
Adding a custom icon for your Shelf Button¶
Occasionally tools will be shipped with an icon. You can use that icon to add it on your shelf button.
Let see how to set that up.
Coming soon!
Create a Hotkey¶
For this example we will be using the Mirror Tool python code as an example.
1 2 | |
To set a Hotkey first open the Hotkey Editor Window located in:
Windows-> Settings/Preferences-> Hotkey Editor.
Once opened, choose Custom Scripts from the Edit Hotkeys dropdown and click on Runtime Command Editor.
From there click on New:
| Name: | Mirror_Tool | |
|---|---|---|
| Description: | Mirror_Tool (use same as Name, you could alternatively use a small description if you like) | |
| Language: | Python (always check on the How to Install page of each tool, to see which language to use) |
Then copy paste the python code underneath the language area.
Once happy click on Save Runtime Command
Your new hotkey should now be added in the custom scripts drowpdown. From there click on the Hotkey area and assign your hotkey.
Important - Close Maya to save HotKey
It's best to close and re-open Maya after saving your hotkeys because if Maya crashes, you will have to repeat the process all over again.














