Usually one could simply store and recall the Maya Preferences File. Here is a simple script if you want to enable default settings.
import pymel.core as pm
def manage_Default_options(**kwargs):
"""
Sets Various Default options for Maya
viewmManip : Default Hide the manipulator Cube
gradient: Default Hide the Background gradient
autosave: Default Enable Autosave
mentalray: Default Enable mr as Default Render Engine
interactiveCreation: Enables Disables Interactive Creation Mode for Primitive Objects
hardware2: Optional Enable Hardware Renderer 2.0 as Default Render Engine
"""
#Disable View Cube
pm.viewManip(visible=kwargs.get("viewManip", False))
#Disable Background Gradient
pm.displayPref(displayGradient=kwargs.get("gradient", False))
#Infinite Undo
pm.undoInfo(state = True, infinity = kwargs.get("infiniteUndo", True))
#Enable Autosave, max Versions 10, interval 15min
pm.autoSave(enable=kwargs.get("autosave", True), maxBackups=kwargs.get("maxBackups", 10), interval=kwargs.get("interval", 900))
#Activate Mental Ray
if (kwargs.get("mentalray", True)): enable_mr_plugin()
#Sets Hardwarerenderer 2.0 as Default
if (kwargs.get("hardware2", False)): pm.PyNode("defaultRenderGlobals").currentRenderer.set("mayaHardware2")
#Expose Mental Ray Production Nodes
pm.optionVar["MIP_SHD_EXPOSE"] = 1
#Disable Interactive Creation
setInteractiveCreation(kwargs.get("interactiveCreation", False))
def setInteractiveCreation(enabled = False):
"""
Enables or Disables Interactive Creation
"""
pm.optionVar['createNurbsPrimitiveAsTool'] = enabled;
pm.ui.CommandMenuItem("MayaWindow|mainCreateMenu|menuItem285|toggleCreateNurbsPrimitivesAsToolItem").setCheckBox(enabled)
pm.optionVar['createPolyPrimitiveAsTool'] = enabled;
pm.ui.CommandMenuItem("MayaWindow|mainCreateMenu|polyPrimitivesItem|toggleCreatePolyPrimitivesAsToolItem").setCheckBox(enabled)
def enable_mr_plugin():
"""
loads and sets the mental Ray Plugin as default
"""
loadPlugin('Mayatomr')
pm.PyNode("defaultRenderGlobals").currentRenderer.set("mentalRay")
print ('# Result: mental ray Plugin loaded #')
def loadPlugin(pluginName):
"""
if the plugin is not loaded, it is loaded and set to autoload
pluginName: name of the plugin to be loaded
"""
if not pm.pluginInfo(pluginName, q=True, loaded=True):
pm.loadPlugin(pluginName)
pm.pluginInfo(pluginName, edit=True, autoload=True)


