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.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
allModules (a) | bool | ||
Load all new modules not yet loaded in Maya. New modules are the one returned by the -scan option.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
load (ld) | unicode | ||
|
|||
scan (sc) | bool | ||
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, not change the Maya state. |
Derived from mel command maya.cmds.loadModule
Example:
import pymel.core as pm
pm.loadModule(scan=True)
# Result: [] #
pm.loadModule(load='myModuleDef')
# Result: [] #
pm.loadModule(allModules=True)
# Result: [] #