Show in Contents
Add to Favorites
Home: Autodesk Maya Online Help
Example: Swapping arms on a robot
Editing Assets
Creating templates and views
Assign a custom command
or menu to a container
You can assign a custom
script to activate when an object in a container is -click.
To assign a custom script to a container
- Select the container in the Outliner.
- Open the Attribute Editor.
- In the container tab, under the Container
Attributes section, enter the name of your custom script
in the Rmb Command field.
You can now activate
the script by either -clicking
an object in the container in the scene view, or -clicking
the container or a contained object in the Outliner and
selecting Container from the marking
menu.
NoteWhen running a custom
script from the Outliner, the script name does not
appear in the marking menu itself. You only need to highlight the Container menu
and then release the mouse button to activate the script.
NoteA script must be
located in your script path (environment variable: MAYA_SCRIPT_PATH)
to be eligible to put in the Rmb Command field.
NoteDo not include the
extension (for example, .mel for a MEL file) in the script name
when entering it in the Rmb Command field.
One way to use this attribute
is to assign a script that adds a custom menu for a specific container
to the existing marking-menu that appears when you -click
a container in the scene or the Outliner (in
the Container section of the marking
menu). An example of such a script named containerRmbMenu.mel is
included with the Maya default scripts. You can find it in your
Maya install directory under scripts/others.