Assign a custom command or menu to an asset
 
 
 

You can assign a custom script to activate when an object in an asset is -clicked.

To assign a custom script to an asset

  1. Select the asset in the Outliner.
  2. Open the Attribute Editor.
  3. In the asset tab, under the Asset 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 asset in the scene view, or

    -clicking the asset or an encapsulated object in the Outliner and selecting Asset from the pop-up menu.
Note

When running a custom script from the Outliner, the script name does not appear in the pop-up menu itself. You only need to highlight the Asset menu and then release the mouse button to activate the script.

Note

A script must be located in your script path (environment variable: MAYA_SCRIPT_PATH) to be eligible to put in the Rmb Command field.

Note

Do 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 asset to the existing pop-up menu that appears when you -click an asset in the scene or in the Outliner (in the Asset section of the pop-up 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.