-
Notifications
You must be signed in to change notification settings - Fork 0
/
PluginMain.cpp
67 lines (58 loc) · 1.66 KB
/
PluginMain.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <maya/MPxCommand.h>
#include <maya/MFnPlugin.h>
#include <maya/MIOStream.h>
#include <maya/MArgList.h>
#include <maya/MDoubleArray.h>
#include <maya/MPoint.h>
#include <maya/MPointArray.h>
#include <maya/MFnNurbsCurve.h>
#include <maya/MDGModifier.h>
#include <maya/MPlugArray.h>
#include <maya/MVector.h>
#include <maya/MFnDependencyNode.h>
#include <maya/MStringArray.h>
#include <list>
#include <maya/MString.h>
#include <maya/MGlobal.h>
#include <maya/MSimple.h>
//#include "ERODECmd.h"
#include "ERODENode.h"
MStatus initializePlugin( MObject obj )
{
MStatus status = MStatus::kSuccess;
MFnPlugin plugin( obj, "ErodePlugin", "1.0", "Any");
// Register Command
// status = plugin.registerCommand( "ERODECmd", ERODECmd::creator );
//register the menu by a MEL script
char buffer[2048];
sprintf_s(buffer, 2048, "source \"%s/ERODE.mel\";", plugin.loadPath().asChar());
MGlobal::executeCommand(buffer, true);
//if (!status) {
// status.perror("registerCommand");
// return status;
//}
status = plugin.registerNode("ERODENode", ERODENode::nodeID,
ERODENode::creator, ERODENode::initialize);
if (!status) {
status.perror("registerNode");
return status;
}
return status;
}
MStatus uninitializePlugin( MObject obj)
{
MStatus status = MStatus::kSuccess;
MFnPlugin plugin( obj );
// status = plugin.deregisterCommand( "ERODECmd" );
MGlobal::executeCommand("deleteUI ERODEMenu");
// if (!status) {
// status.perror("deregisterCommand");
// return status;
// }
status = plugin.deregisterNode(ERODENode::nodeID);
if (!status) {
status.perror("deresigerNode");
return status;
}
return status;
}