Ever wanted more space on your shelf?
maya-toolbar is a user interface designed to quickly access and execute user-defined commands.
Features
- Resizable UI
- Dockable UI
- Persistent UI
- Customizable
Table of Contents
- System Requirements
- Installation
- Usage
- Add New Tabs
- YAML References
- Execute function
- Environment Variables
- Special Thanks
System Requirements
-
Autodesk Maya (2020+)
In theory, it may run in older maya versions, but those are never being tested. If you try to use it on one of these versions and everything seems to works properly, please do not hesitate to let me know! :)
Note that the tool does not currently support maya 2025+ due to the upgrade of the pyside library to the version 6. I plan to add a support using the Qt.py in a future release.
-
This will allow to write proper and readable configuration files that the UI will read to generate the user interface. The library is not included with the Maya installation, so we need to install it separately. Please see the installation section below for details.
Installation
The installation can be done using two different methods.
Manual
-
Located the maya script directory (or any other directory that will be available in the
PYTHONPATH).- Linux
~/maya/scripts~/maya/{VERSION}/scripts
- Windows
~/Documents/maya/scripts~/Documents/maya/{VERSION}/scripts
- Mac OS
Library/Preferences/Autodesk/maya/scriptsLibrary/Preferences/Autodesk/maya/{VERSION}/scripts
- Linux
-
Install
pyyamlpackage.If your workstation is in a studio, there is a good chance that the library is already installed. If you are not sure, you can try running the following code:
import yaml
If an
ImportErroris raised, the library needs to be installed, otherwise, you're good to go :)The easiest way to install it is to use
pip. The--targetoption allows us to change the directory in which the package will be installed. In our case, we want to use the scripts directory found above (or another directory that is a part of thePYTHONPATH).pip install pyyaml --target ~/maya/scripts
-
Download the file
maya_toolbar.pyand save it inside the scripts directory. -
See usage below.
pip
maya-toolbar is also uploaded on PyPI and can directly be installed using pip. This means that all the dependencies will be automatically be installed without doing anything else!
pip install maya-toolbar
Like in the manual section, its possible to use the --target option to install the package in other directory, for example, the maya scripts folder.
Usage
To open the toolbar, get a new python tab inside the script editor, and execute the following lines:
import maya_toolbar
maya_toolbar.show()
The user interface will added to the current workspace. This means that it will automatically reopen where it was left for the next Maya session!
Enjoy! :)
Add New Tabs
Each tab is represented by a single YAML file which contains all the configuration to generate the UI.
By default the tabs will be searched in the following directories (where ~ represent the $HOME directory):
- Linux
~/toolbar~/maya/toolbar~/maya/{VERSION}/prefs/toolbar
- Windows
~/toolbar~/Documents/maya/toolbar~/Documents/maya/{VERSION}/prefs/toolbar
- Mac OS
~/toolbarLibrary/Preferences/Autodesk/maya/toolbarLibrary/Preferences/Autodesk/maya/{VERSION}/prefs/toolbar
In addition to these directories, every maya module that contains a directory called toolbar will also be included.
Arbitrary directories can also be added using the TOOLBAR_PATH_DISCOVER environment variable or directly from the python interpreter using the PATH_DISCOVER attribute:
export TOOLBAR_PATH_DISCOVER = $TOOLBAR_PATH_DISCOVER:path/to/directory
import maya_toolbar
maya_toolbar.PATH_DISCOVER.append("path/to/directory")
maya_toolbar.show()
YAML References
All the configure of the toolbar are done through YAML files. There will be no explanation of syntax here but its possible to learn it from the official documentation.
See bellow all the different options available for each component of the toolbar.
Tab
name(str) - The name of the tab. If not specified, the name of the file will be used (without the extensions).load(bool) - Specify if the configuration should be loaded as a tab or not. Defaults toAUTOLOAD.categories(list) - The configuration of the categories.
name: demo
load: true
categories: []
Category
name(str) - The name of the category.open(bool) - Should the category be extended or collapsed by default? Defaults tofalse.commands(list) - The configuration of the commands.
name: Category A
open: false
commands: []
Command
name(str) - The name of the command (Displayed as a tooltip).icon(str) - The icon with which the command will be displayed.label(str) - A short text that will be displayed below the command.callback(str) - The function that should be executed (see the syntax here).menu(dict) - The configuration of the menu.
name: Command A
icon: :mayaCommand.png
label: a
callback: maya.cmds:NewScene
menu: {}
Menu
click(str) - The click that will show the menu (leftorright). Defaults toright.items(list) - The item to add as children.
name: Menu A
click: right
items: []
Menu item
type(str) - The type of the item to add. For each of them, different options are available:
Additional options are available according to the specified type:
command
name(str) - The name of the command.icon(str) - The icon with which the command will be displayed.callback(str) - The function that should be executed (see the syntax here).
type: command
name: Menu command A
icon: :mayaCommand.png
callback: maya.cmds:NewScene
separator
No options are available.
type: separator
menu
name(str) - The name of the menu.icon(str) - The icon with which the menu will be displayed.items(list) - The item to add as children.
type: menu
name: Menu A
icon: :mayaCommand.png
items: []
Execute function
To call a function, a special syntax similar to setuptools is used. The package name is separated from the function name using a :, where the package can be anything accessible from python (inside the PYTHONPATH)).
So for example, if we have a module called commands.py available inside our PYTHONPATH and that contains the following code:
def hello_world():
print("Hello Word!")
Inside the YAML configuration file, we can point to our hello_world function using:
callback: commands:hello_world
Environment Variables
Functionalities of the toolbar can be modified using environment variables.
TOOLBAR_PATH_DISCOVER
Similar to what python does with the PYTHONPATH) variable, this allows the specified custom path to include in the search for the tab configuration file.
echo $TOOLBAR_PATH_DISCOVER
The equivalent attribute in the python module is PATH_DISCOVER:
import maya_toolbar
maya_toolbar.PATH_DISCOVER
TOOLBAR_ACTIVE_TAB
The name of the tab that should have the focus when the user interface is opened or reloaded.
echo $TOOLBAR_ACTIVE_TAB
The equivalent attribute in the python module is ACTIVE_TAB:
import maya_toolbar
maya_toolbar.ACTIVE_TAB
TOOLBAR_AUTOLOAD
Set the default loading behaviour for discovered configuration files.
1 means that all configuration files will be automatically loaded, unless load: false is explicitly specified.
0 is the exact opposite. Each configuration file will not be considered for loading unless the load: true option is specified.
echo $TOOLBAR_AUTOLOAD
The equivalent attribute in the python module is AUTOLOAD:
import maya_toolbar
maya_toolbar.AUTOLOAD
Special Thanks
- @BenoitGielly for the original idea and implementation!
Metadata
Release files for maya-toolbar 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| maya_toolbar-0.2.0.tar.gz | 13.0 kB | Without provenance | Details for maya_toolbar-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| maya_toolbar-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for maya_toolbar-0.2.0-py3-none-any.whl |
Total release size: 26.0 kB
Release files / maya_toolbar-0.2.0.tar.gz
| Download URL | maya_toolbar-0.2.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
616e819a8beb684615e8c796b74f6360359f56cb907883726dc38e9f4b0c4c06
|
|
BLAKE2b-256 checksum How to use checksums |
a7257d18df6d9ec5baefbddbf1090dc1fb4c0318824843e5f8d126aeb522aa2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / maya_toolbar-0.2.0-py3-none-any.whl
| Download URL | maya_toolbar-0.2.0-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49f53462b5e30a289d39d91225a6fd87796cfc910f5fc85f50cce8417065998a
|
|
BLAKE2b-256 checksum How to use checksums |
6a6f5a55898c3767529168f23546338c1a52818354edeba4e8dad6dc4a346442
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for maya-toolbar 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.