Go to: Synopsis. Return value. Flags. Python examples.
menuSetPref( [object] , [exists=boolean], [force=boolean], [loadAll=boolean], [removeAll=boolean], [saveAll=boolean], [saveBackup=boolean], [version=boolean])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
menuSetPref is undoable, queryable, and editable.
Provides the functionality to save and load menuSets between
sessions of Maya. For Internal Use Only!
None
In query mode, return type is based on queried flag.
exists, force,
loadAll, removeAll, saveAll,
saveBackup, version
Long name (short name) |
Argument types |
Properties |
saveAll(sa) |
boolean |
 |
|
Saves all the current menuSets into the preferences file. |
|
saveBackup(sb) |
boolean |
 |
|
Saves a backup of the current menu set preferences file if one
exists. This backup will be saved in the same location as the
current preferences file. |
|
loadAll(la) |
boolean |
 |
|
Loads all the menuSets from the preferences file only if the
preferences version matches, or the -force flag is enabled. On
successful load, of a prefs file, an empty string is returned,
otherwise, a description of the problem encountered is
returned. |
|
removeAll(ra) |
boolean |
 |
|
Removes all the menuSets from the preferences file (removes the
whole file). |
|
force(f) |
boolean |
  |
|
Forces a specified operation to continue even if errors are
encountered (such as invalid preferences). |
|
exists(e) |
boolean |
 |
|
Returns whether the menuSet preferences file exists or
not. |
|
version(v) |
boolean |
 |
|
The base version string which is saved out to file. It is also
checked upon loading in order to indicate changes in the default
prefs since the prefs were last saved out. |
|
Flag can appear in Create mode of
command |
Flag can appear in Edit mode of command |
Flag can appear in Query mode of command |
Flag can have multiple arguments, passed
either as a tuple or a list. |
import maya.cmds as cmds
# saving the current menuSets
cmds.menuSetPref( saveAll=True )
# loading to the current menuSets if they exist
if cmds.menuSetPref(exists=True) :
cmds.menuSetPref(loadAll=True)
# in certain cases, you may wish to remove previous preferences before saving
cmds.menuSetPref( removeAll=True )