Plug-in entry points
Every plug-in must implement both initializePlugin()
and uninitializePlugin()
functions as entry points into the plug-in. These functions register and deregister the additions to Maya defined in the plug-in.
initializePlugin()
is called when Maya loads the plug-in. It contains code to register the commands, nodes, tools, and other additions to Maya defined by the plug-in.
uninitializePlugin()
is called when the plug-in is unloaded. It deregisters anything that was registered when the plug-in was loaded.
For a command plug-in, initializePlugin()
must call registerCommand()
to register the command. Similarly, uninitializePlugin()
calls deregisterCommand()
.
For a dependency node plug-in, initializePlugin()
must call registerNode()
to register the command. Similarly, uninitializePlugin()
calls deregisterNode()
.
The plug-in will fail to load if either initializePlugin()
or uninitializePlugin()
is missing.
Examples of how to implement these functions can be found in any of the devkit plug-in examples.