#include <math.h>
#include <maya/MPxNode.h>
#include <maya/MIOStream.h>
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPlug.h>
#include <maya/MDataBlock.h>
#include <maya/MDataHandle.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFloatVector.h>
#include <maya/MFnPlugin.h>
{
public:
InterpNode();
~InterpNode() override;
SchedulingType
schedulingType()
const override {
return SchedulingType::kParallel; }
static void * creator();
private:
};
InterpNode::InterpNode()
{
}
InterpNode::~InterpNode()
{
}
void* InterpNode::creator()
{
return new InterpNode();
}
{
aNormalCamera = nAttr.
createPoint(
"normalCamera",
"n");
return MS::kSuccess;
}
{
if ((plug != aOutColor) && (plug.
parent() != aOutColor))
return MS::kUnknownParameter;
float scalarNormal = (viewVector.
x * surfNorm.
x) +
(viewVector.
y * surfNorm.
y) +
(viewVector.
z * surfNorm.
z);
if (scalarNormal < 0.0) scalarNormal = -scalarNormal;
float scalar;
if (power > 0.0) {
scalar = powf(scalarNormal, 1.0f / power);
}
else { scalar = 0.0; }
resultColor = Side + ((Face - Side) * scalar);
outColor = resultColor;
return MS::kSuccess;
}
{
const MString UserClassify(
"utility/general" );
MFnPlugin plugin( obj, PLUGIN_COMPANY,
"4.5",
"Any");
CHECK_MSTATUS ( plugin.registerNode(
"interpNode", InterpNode::id,
InterpNode::creator, InterpNode::initialize,
return MS::kSuccess;
}
{
return MS::kSuccess;
}