Go to: Synopsis. Flags. Return value. Related. Python examples.
loadPlugin(
fileName1 [fileName2] ...
, [addCallback=string], [allPlugins=boolean], [name=string], [quiet=boolean], [removeCallback=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
loadPlugin is undoable, queryable, and editable.
Load plug-ins into Maya. The parameter(s) to this command
are either the names or pathnames of plugin files. The
convention for naming plugins is to use a .so extension on
IRIX and a .mll extension on Windows.
MAYA_PLUG_IN_PATH will be searched looking for a file with
the given name. If you specified the plug-in without an
extension, the appropriate one for the platform will be
automatically appended.
When the plug-in is loaded, the name used in Maya's
internal plug-in registry for the plug-in information will
be the file name with the extension removed. For example,
if you load the plugin "newNode.mll" the name used in
the Maya's registry will be "newNode". This value as
well as that value with either a ".so" or ".mll" extension
can be used as valid arguments to either the unloadPlugin
or pluginInfo commands.
addCallback, allPlugins, name, quiet, removeCallback
Long name (short name) |
[argument types] |
Properties |
name(n)
|
string
|
|
|
Set a user defined name for the plug-ins
that are loaded. If the name is already taken, then a number
will be added to the end of the name to make it unique.
|
|
allPlugins(a)
|
boolean
|
|
|
Cause all plug-ins in the search path specified
in MAYA_PLUG_IN_PATH to be loaded.
|
|
quiet(qt)
|
boolean
|
|
|
Don't print a warning if you attempt to load a plug-in that
is already loaded.
|
|
addCallback(ac)
|
string
|
|
|
Add a MEL or Python callback script to be called after a plug-in is loaded.
For MEL, the procedure should have the following signature:
global proc procedureName(string $pluginName).
For Python, you may specify either a script as a string, or a Python callable
object such as a function. If you specify a string, then put the formatting
specifier "%s" where you want the name of the plug-in to be inserted. If you
specify a callable such as a function, then the name of the plug-in will be
passed as an argument.
|
|
removeCallback(rc)
|
string
|
|
|
Removes a procedure which was previously added
with -addCallback.
|
|
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.
|
[string[]] the internal names of the successfully loaded plug-ins
openMayaPref, pluginInfo, unloadPlugin
import maya.cmds as cmds
# Load the plugin named "newNode" into Maya.
#
cmds.loadPlugin( 'newNode.py' )
# Load all the plugins found in all the directories that are
# included in MAYA_PLUG_IN_PATH.
#
cmds.loadPlugin( allPlugins=True )