Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

savePrefs([colors=boolean], [file=string], [general=boolean], [hotkeys=boolean], [menuSets=boolean], [plugins=boolean], [uiLayout=boolean])

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

savePrefs is undoable, NOT queryable, and NOT editable.

This command saves preferences to disk. If no flags are specified then all pref types get saved out.

Return value

None

Flags

colors, file, general, hotkeys, menuSets, plugins, uiLayout
Long name (short name) Argument types Properties
colors(c) boolean create
Save the color prefs to disk
file(f)
2023
string create
Save a specific preference file. Used to save preferences that are using optionVar -prefFile to save items to a different file.
general(g) boolean create
Save the general prefs to disk (optionVars)
hotkeys(hk) boolean create
Save the hotkeys to disk
menuSets(ms) boolean create
Save the menuSet preferences to disk
plugins(pl) boolean create
Save the plug-in prefs to disk
uiLayout(ui) boolean create
Save each window's size and position to disk

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.

Python examples

import maya.cmds as cmds

# only save the hotkeys
cmds.savePrefs( hotkeys=True )

# save everything
cmds.savePrefs()

# only save ui layout prefs
cmds.savePrefs( uiLayout=True )