#include "pointOnMeshInfoNode.h"
#include "getPointAndNormal.h"
#include <maya/MIOStream.h>
MTypeId pointOnMeshInfoNode::id(0x00105480);
MObject pointOnMeshInfoNode::aInMesh;
MObject pointOnMeshInfoNode::aFaceIndex;
MObject pointOnMeshInfoNode::aRelative;
MObject pointOnMeshInfoNode::aParameterU;
MObject pointOnMeshInfoNode::aParameterV;
MObject pointOnMeshInfoNode::aPosition;
MObject pointOnMeshInfoNode::aPositionX;
MObject pointOnMeshInfoNode::aPositionY;
MObject pointOnMeshInfoNode::aPositionZ;
MObject pointOnMeshInfoNode::aNormal;
MObject pointOnMeshInfoNode::aNormalX;
MObject pointOnMeshInfoNode::aNormalY;
MObject pointOnMeshInfoNode::aNormalZ;
pointOnMeshInfoNode::pointOnMeshInfoNode()
{
}
pointOnMeshInfoNode::~pointOnMeshInfoNode()
{
}
void *pointOnMeshInfoNode::creator()
{
return new pointOnMeshInfoNode();
}
MStatus pointOnMeshInfoNode::initialize()
{
aPosition = pointAttrFn.
create(
"position",
"p", aPositionX, aPositionY, aPositionZ);
aNormal = normalAttrFn.
create(
"normal",
"n", aNormalX, aNormalY, aNormalZ);
}
{
if ((plug == aPosition) || (plug == aPositionX) || (plug == aPositionY) || (plug == aPositionZ)
|| (plug == aNormal) || (plug == aNormalX) || (plug == aNormalY) || (plug == aNormalZ))
{
int faceIndex = faceIndexDataHandle.
asLong();
bool relative = relativeDataHandle.
asBool();
double parameterU = parameterUDataHandle.
asDouble();
double parameterV = parameterVDataHandle.
asDouble();
getPointAndNormal(dummyDagPath, faceIndex, relative, parameterU, parameterV, point, normal, inMesh);
pointDataHandle.
set(point.
x, point.
y, point.
z);
normalDataHandle.
set(normal.
x, normal.
y, normal.
z);
}
else
}