移動先: 概要 戻り値 フラグ. Python 例.
menuSet(
[object]
, [addMenu=string], [allMenuSets=boolean], [currentMenuSet=string], [exists=string], [hotBoxVisible=boolean], [insertMenu=[string, uint]], [label=string], [menuArray=[string,...]], [moveMenu=[string, uint]], [moveMenuSet=[string, uint]], [numberOfMenuSets=boolean], [numberOfMenus=boolean], [permanent=boolean], [removeMenu=string], [removeMenuSet=string])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
menuSet は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
メイン メニュー バーに表示するメニューを論理的に順序付けするメニュー セットを作成します。このメニュー セットは動的に編集や順序変更を行うことができます。
string | 結果のメニュー セットの名前。(残りのメニュー セットがない場合は、空の文字列) |
戻り値の型は照会モードでは照会フラグが基になります。
addMenu, allMenuSets, currentMenuSet, exists, hotBoxVisible, insertMenu, label, menuArray, moveMenu, moveMenuSet, numberOfMenuSets, numberOfMenus, permanent, removeMenu, removeMenuSet
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
# creating a new menu set;
cmds.menuSet( 'newMenuSetObjName', label='newMenuSet Label' )
# using commands on a current menu set
# first find the menu set if you don't know the name of it
animMS = maya.mel.eval('findMenuSetFromLabel("Animation")')
# menu sets can be queried like normal commands
animMenus = cmds.menuSet(animMS, query=True, menuArray=True)
# but editing the set requires either setting the current menu set...
# (notice that the menu set comamnds following specify no specific menu set)
cmds.menuSet( currentMenuSet=animMS )
cmds.menuSet( removeMenu=animMenus[0] )
# : (other commands which pertain to the animation menu set)
# .. or temporarily setting the menu set to work on (does not affect current menu set)
# (notice that every command following specifies the specific set to apply operations to)
polyMS = maya.mel.eval('findMenuSetFromLabel("Polygons")')
polyMenus = cmds.menuSet(polyMS, query=True, menuArray=True)
cmds.menuSet( modelMS, removeMenu=polyMenus[0], insertMenu=(polyMenus[1], 0) )
# .. where the following commands still affect the animation menu set
animMenus = cmds.menuSet(query=True, menuArray=True)
# if you need to find a specific menu...
deformMenu = maya.mel.eval( ('findMenuFromMenuSet(\"' + animMS + '\", "Deform")') )
# moving a menu from one spot to another
# (ie. moving the Deform Menu to the front of the list)
cmds.menuSet( moveMenu=(deformMenu, 0) )