-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathPluginMain.cpp
54 lines (37 loc) · 1.68 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
#include "SeamsEasyNode.h"
#include "SeamsEasyCmd.h"
#include "StitchEasyNode.h"
#include "StitchEasyCmd.h"
#include "StitchEasyCtxCmd.h"
#include <maya/MFnPlugin.h>
MStatus initializePlugin(MObject object) {
MStatus status;
MFnPlugin fnPlugin(object, "Stepan Jirka", "1.0", "Any", &status);
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.registerNode("stitchEasy", StitchEasyNode::id, StitchEasyNode::creator, StitchEasyNode::initialize);
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.registerNode("seamsEasy", SeamsEasyNode::id, SeamsEasyNode::creator, SeamsEasyNode::initialize);
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.registerCommand("stitchEasy", StitchEasyCmd::creator, StitchEasyCmd::newSyntax);
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.registerCommand("seamsEasy", SeamsEasyCmd::creator, SeamsEasyCmd::newSyntax);
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.registerContextCommand("stitchEasyCtx", StitchEasyCtxCmd::creator);
CHECK_MSTATUS_AND_RETURN_IT(status);
return MS::kSuccess;
}
MStatus uninitializePlugin(MObject object) {
MStatus status;
MFnPlugin fnPlugin(object);
status = fnPlugin.deregisterContextCommand("stitchEasyCtx");
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.deregisterNode(StitchEasyNode::id);
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.deregisterNode(SeamsEasyNode::id);
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.deregisterCommand("stitchEasy");
CHECK_MSTATUS_AND_RETURN_IT(status);
status = fnPlugin.deregisterCommand("seamsEasy");
CHECK_MSTATUS_AND_RETURN_IT(status);
return MS::kSuccess;
}