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

Synopsis

openMayaPref([errlog=boolean], [lazyLoad=boolean], [oldPluginWarning=boolean])

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

openMayaPref is undoable, queryable, and editable.

Set or query API preferences.

Return value

intindicates success or failure

In query mode, return type is based on queried flag.

Related

loadPlugin, pluginInfo, unloadPlugin

Flags

errlog, lazyLoad, oldPluginWarning
Long name (short name) Argument types Properties
lazyLoad(lz) boolean createqueryedit
toggles whether or not plugins will be loaded with the RTLD_NOW flag or the RTLD_LAZY flag of dlopen(3C). If set to true, RTLD_LAZY will be used. In this mode references to functions that cannot be resolved at load time will not be considered an error. However, if one of these symbols is actually dereferenced by the plug-in at run time, Maya will crash. Defaults to false(off).
oldPluginWarning(ow) boolean createqueryedit
toggles whether or not loadPlugin will generate a warning when plug-ins are loaded that were compiled against an older, and possibly incompatible Maya release. Defaults to true(on).
errlog(el) boolean createqueryedit
toggles whether or not an error log of failed API method calls will be created. When set to true, a file called "OpenMayaErrorLog" will be created in Maya's current working directory. Each time an API method fails, a detailed description of the error will be written to the file along with a mini-stack trace that indicates the routine that called the failing method. Defaults to false(off).

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

# Enable RTLD_LAZY binding when loading plug-ins
cmds.openMayaPref( lz=True )

# Force RTLD_NOW binding when loading plug-ins
cmds.openMayaPref( lz=False )

# Disable the warning about old plug-ins being loaded
cmds.openMayaPref( ow=False )

# Turn on the Error log
cmds.openMayaPref( errlog=True )

# Query the Error log
cmds.openMayaPref( q=True, errlog=True )

# Turn off the Error log
cmds.openMayaPref( errlog=False )