Maya runTimeCommand from menu
new in 2022
shows up in Maya search
- good example maya docs
For example, if you had a script userSetup.py that creates a menu containing special Foo rendering scripts, you would need to convert this:
cmds.menuItem(
p = renderingMenu,
l = 'Submit to Foo',
c = 'import foo_maya;foo_maya.submit_dialog()')
to this:
# Create runTimeCommand
cmds.runTimeCommand('SubmitToFoo',
default = True,
label = 'Send to Foo',
annotation = 'Send your scene to Foo for cloud rendering.',
category = 'Menu items.Cloud.Render',
command = 'import foo_maya;foo_maya.submit_dialog()',
keywords = 'render',
tags = 'Render' )
# Create menu
cmds.menuItem(
p = renderingMenu,
rtc = 'SubmitToFoo')
- command reference docs
- supports tags & categories
- can enable a plugin it relies on
- can have an image (icon)
- todo example
Backlinks¶
- Maya search
- To show your custom command in Maya search, see Maya runTimeCommand from menu
- RnD to add to maya windows menu on startup
- but am interested in Maya runTimeCommand from menu
- Maya MPxCommand
- [!warning] see runtime commands
- Maya menu documentation