pluginCallbacks/pluginCallbacks.cpp
#include <maya/MIOStream.h>
#include <maya/MPxNode.h>
#include <maya/MFnPlugin.h>
#include <maya/MSceneMessage.h>
void prePluginLoadCallback(
const MStringArray &str,
void* cd )
{
cerr <<
"PRE plugin load callback with " << str.
length() <<
" items: \n";
for (
unsigned int i = 0; i < str.
length(); i++ )
{
cerr << "\tCallback item " << i << " is : " << str[i] << endl;
}
}
void postPluginLoadCallback(
const MStringArray &str,
void* cd )
{
cerr <<
"POST plugin load callback with " << str.
length() <<
" items: \n";
for (
unsigned int i = 0; i < str.
length(); i++ )
{
cerr << "\tCallback item " << i << " is : " << str[i] << endl;
}
}
void prePluginUnloadCallback(
const MStringArray &str,
void* cd )
{
cerr <<
"PRE plugin unload callback with " << str.
length() <<
" items: \n";
for (
unsigned int i = 0; i < str.
length(); i++ )
{
cerr << "\tCallback item " << i << " is : " << str[i] << endl;
}
}
void postPluginUnloadCallback(
const MStringArray &str,
void* cd )
{
cerr <<
"POST plugin unload callback with " << str.
length() <<
" items: \n";
for (
unsigned int i = 0; i < str.
length(); i++ )
{
cerr << "\tCallback item " << i << " is : " << str[i] << endl;
}
}
static MCallbackId prePluginLoadCallbackId;
static MCallbackId postPluginLoadCallbackId;
static MCallbackId prePluginUnloadCallbackId;
static MCallbackId postPluginUnloadCallbackId;
{
prePluginLoadCallback,
NULL, &status);
postPluginLoadCallback,
NULL, &status);
prePluginUnloadCallback,
NULL, &status);
postPluginUnloadCallback,
NULL, &status);
return MS::kSuccess;
}
{
return MS::kSuccess;
}