saveShelf(
string string
)
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
saveShelf は、取り消し可能、照会不可能、および編集不可能です。
このコマンドは指定されたシェルフ(1 番目の引数)を指定されたファイル(2 番目の引数)に保存します。 このコマンドは、MEL および Python コマンドのコールバックが混在するコントロールと一緒に使用すると、正しく動作しないことに注意してください。また、メニューの状態が MEL ファイルに保存されるため、コール可能な Python オブジェクトであるコールバックに対しては動作しません。| boolean | 成功の場合は true です。 |
import maya.cmds as cmds
# Create a window with a shelf in it.
#
window = cmds.window()
tabs = cmds.tabLayout()
shelf = cmds.shelfLayout()
cmds.shelfButton( '\"Hello\\n\"")', image1='commandButton.png', command='("print' )
cmds.tabLayout( tabs, edit=True, tabLabel=(str(shelf),'Example Shelf') )
cmds.showWindow( window )
# At this point the example would be made more interesting if you
# put some additional items on this shelf.
# Now save the shelf in the temp directory.
#
tempDir = cmds.internalVar( userTmpDir=True )
cmds.saveShelf( shelf, (tempDir + 'ExampleShelf') );