Go to: Synopsis. Return value. Python examples.

Synopsis

saveShelf( string string )

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

saveShelf is undoable, NOT queryable, and NOT editable.

This command saves the specified shelf (first argument) to the specified file (second argument).

Return value

booleanTrue if successful.

Python examples

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.xpm', 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') );