-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpluginMain.cpp
More file actions
60 lines (52 loc) · 1.4 KB
/
pluginMain.cpp
File metadata and controls
60 lines (52 loc) · 1.4 KB
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
//
// Copyright (C)
//
// File: pluginMain.cpp
//
// Author: Maya Plug-in Wizard 2.0
//
#include "closestPointOnSurfaceNodeNode.h"
#include <maya/MFnPlugin.h>
#include <maya/MStreamUtils.h>
MStatus initializePlugin( MObject obj )
//
// Description:
// this method is called when the plug-in is loaded into Maya. It
// registers all of the services that this plug-in provides with
// Maya.
//
// Arguments:
// obj - a handle to the plug-in object (use MFnPlugin to access it)
//
{
std::cout.set_rdbuf(MStreamUtils::stdOutStream().rdbuf());
std::cerr.set_rdbuf(MStreamUtils::stdErrorStream().rdbuf());
MStatus status;
MFnPlugin plugin( obj, "", "2018", "Any");
status = plugin.registerNode( "closestPointOnSurfaceNode", closestPointOnSurfaceNode::id, closestPointOnSurfaceNode::creator,
closestPointOnSurfaceNode::initialize );
if (!status) {
status.perror("registerNode");
return status;
}
return status;
}
MStatus uninitializePlugin( MObject obj)
//
// Description:
// this method is called when the plug-in is unloaded from Maya. It
// deregisters all of the services that it was providing.
//
// Arguments:
// obj - a handle to the plug-in object (use MFnPlugin to access it)
//
{
MStatus status;
MFnPlugin plugin( obj );
status = plugin.deregisterNode( closestPointOnSurfaceNode::id );
if (!status) {
status.perror("deregisterNode");
return status;
}
return status;
}