Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.
loadModule([allModules=boolean], [load=string], [scan=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
loadModule is NOT undoable, NOT queryable, and NOT editable.
Maya plug-ins may be installed individually within one of Maya's standard plug-in directories, or they may be packaged up with other resources in a "module". Each module resides in its own directory and provides a module definition file to make Maya aware of the plug-ins it provides.
When Maya starts up it loads all of the module files it finds, making the module's plug-ins, scripts and other resources available for use. Note that the plug-ins themselves are not loaded at this time, Maya is simply made aware of them so that they can be loaded if needed.
The loadModule command provides the ability to list and load any new modules which have been added since Maya started up, thereby avoiding the need to restart Maya before being able to use them.
module
loadPlugin, moduleInfo, pluginInfo, unloadPlugin
allModules, load, scan
Long name (short name) |
Argument types |
Properties |
allModules(a)
|
boolean
|
|
|
Load all new modules not yet loaded in Maya. New modules are the one returned by the -scan option.
|
|
load(ld)
|
string
|
|
|
Load the module specified by the module definition file.
|
|
scan(sc)
|
boolean
|
|
|
Rescan module presence. Returns the list of module definition files found and not yet loaded into Maya. Does not load any of these newly found modules, nor change the Maya state.
|
|
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
cmds.loadModule(scan=True)
cmds.loadModule(load='myModuleDef')
cmds.loadModule(allModules=True)