Go to: Synopsis. Return value. Flags. Python examples.
menuItem(
[string]
, [allowOptionBoxes=boolean], [annotation=string], [boldFont=boolean], [checkBox=boolean], [collection=string], [command=script], [data=int], [defineTemplate=string], [divider=boolean], [dividerLabel=string], [docTag=string], [dragDoubleClickCommand=script], [dragMenuCommand=script], [echoCommand=boolean], [enable=boolean], [enableCommandRepeat=boolean], [exists=boolean], [familyImage=string], [image=string], [imageOverlayLabel=string], [insertAfter=string], [isCheckBox=boolean], [isOptionBox=boolean], [isRadioButton=boolean], [italicized=boolean], [label=string], [longDivider=boolean], [ltVersion=string], [optionBox=boolean], [optionBoxIcon=string], [parent=string], [postMenuCommand=script], [postMenuCommandOnce=boolean], [radialPosition=string], [radioButton=boolean], [sourceType=string], [subMenu=boolean], [tearOff=boolean], [useTemplate=string], [version=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
menuItem is undoable, queryable, and editable.
This command creates/edits/queries menu items.string | Full path name to the menu item. |
In query mode, return type is based on queried flag.
Long name (short name) | Argument types | Properties | ||
---|---|---|---|---|
allowOptionBoxes(aob)
|
boolean
|
![]() ![]() |
||
|
||||
annotation(ann)
|
string
|
![]() ![]() ![]() |
||
|
||||
boldFont(bld)
|
boolean
|
![]() ![]() |
||
|
||||
checkBox(cb)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
collection(cl)
|
string
|
![]() ![]() |
||
|
||||
command(c)
|
script
|
![]() ![]() ![]() |
||
|
||||
data(da)
|
int
|
![]() ![]() ![]() |
||
|
||||
defineTemplate(dt)
|
string
|
![]() |
||
|
||||
divider(d)
|
boolean
|
![]() ![]() |
||
|
||||
dividerLabel(dl)
|
string
|
![]() ![]() ![]() |
||
|
||||
docTag(dtg)
|
string
|
![]() ![]() ![]() |
||
|
||||
dragDoubleClickCommand(ddc)
|
script
|
![]() ![]() ![]() |
||
|
||||
dragMenuCommand(dmc)
|
script
|
![]() ![]() ![]() |
||
|
||||
echoCommand(ec)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
enable(en)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
enableCommandRepeat(ecr)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
exists(ex)
|
boolean
|
![]() |
||
|
||||
familyImage(fi)
|
string
|
![]() |
||
|
||||
image(i)
|
string
|
![]() ![]() ![]() |
||
|
||||
imageOverlayLabel(iol)
|
string
|
![]() ![]() ![]() |
||
|
||||
insertAfter(ia)
|
string
|
![]() |
||
|
||||
isCheckBox(icb)
|
boolean
|
![]() |
||
|
||||
isOptionBox(iob)
|
boolean
|
![]() |
||
|
||||
isRadioButton(irb)
|
boolean
|
![]() |
||
|
||||
italicized(itl)
|
boolean
|
![]() ![]() |
||
|
||||
label(l)
|
string
|
![]() ![]() ![]() |
||
|
||||
longDivider(ld)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
ltVersion(lt)
|
string
|
![]() ![]() ![]() |
||
|
||||
optionBox(ob)
|
boolean
|
![]() ![]() |
||
|
||||
optionBoxIcon(obi)
|
string
|
![]() ![]() ![]() |
||
|
||||
parent(p)
|
string
|
![]() |
||
|
||||
postMenuCommand(pmc)
|
script
|
![]() ![]() ![]() |
||
|
||||
postMenuCommandOnce(pmo)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
radialPosition(rp)
|
string
|
![]() ![]() ![]() |
||
|
||||
radioButton(rb)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
sourceType(stp)
|
string
|
![]() ![]() ![]() |
||
|
||||
subMenu(sm)
|
boolean
|
![]() ![]() |
||
|
||||
tearOff(to)
|
boolean
|
![]() ![]() |
||
|
||||
useTemplate(ut)
|
string
|
![]() |
||
|
||||
version(ver)
|
string
|
![]() ![]() ![]() |
||
|
![]() |
![]() |
![]() |
![]() |
import maya.cmds as cmds cmds.window( menuBar=True, width=200 ) cmds.menu( label='Stuff' ) cmds.menuItem( subMenu=True, label='Colors' ) cmds.menuItem( label='Blue' ) cmds.menuItem( label='Green' ) cmds.menuItem( label='Yellow' ) cmds.setParent( '..', menu=True ) cmds.menuItem( divider=True, dividerLabel='Section 1' ) cmds.radioMenuItemCollection() cmds.menuItem( label='Yes', radioButton=False ) cmds.menuItem( label='Maybe', radioButton=False ) cmds.menuItem( label='No', radioButton=True ) cmds.menuItem( divider=True, dividerLabel='Section 2' ) cmds.menuItem( label='Top', checkBox=True ) cmds.menuItem( label='Middle', checkBox=False ) cmds.menuItem( divider=True, longDivider=False ) cmds.menuItem( label='Bottom', checkBox=True ) cmds.menuItem( divider=True ) cmds.menuItem( label='Option' ) cmds.menuItem( optionBox=True ) cmds.columnLayout() cmds.button() cmds.button() cmds.button() cmds.showWindow()