#include <string.h>
#include <maya/MIOStream.h>
#include <maya/MPxNode.h>
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPlug.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MVector.h>
#include <maya/MFnPlugin.h>
#include <maya/MDataBlock.h>
#include <maya/MDataHandle.h>
#include <math.h>
{
public:
circle();
~circle() override;
static void* creator();
public:
};
void* circle::creator()
{
return new circle();
}
{
&stat );
&stat );
&stat );
0.0, &stat );
0.0, &stat );
return MS::kSuccess;
}
circle::circle() {}
circle::~circle() {}
{
if (plug == sOutput || plug == cOutput) {
float currentFrame = inputData.
asFloat();
float scaleFactor = scaleData.
asFloat();
float framesPerCircle = framesData.
asFloat();
float angle = 6.2831853f * (currentFrame/framesPerCircle);
float sinResult = sinf (angle) * scaleFactor;
float cosResult = cosf (angle) * scaleFactor;
&returnStatus );
&returnStatus );
sinHandle.
set( sinResult );
cosHandle.
set( cosResult );
} else {
return MS::kUnknownParameter;
}
return MS::kSuccess;
}
{
MFnPlugin plugin( obj, PLUGIN_COMPANY,
"4.5",
"Any");
status = plugin.registerNode( "circle", circle::id,
circle::creator, circle::initialize );
if (!status) {
status.
perror(
"registerNode");
return status;
}
return status;
}
{
status = plugin.deregisterNode( circle::id );
if (!status) {
status.
perror(
"deregisterNode");
return status;
}
return status;
}