#include <maya/MPxLocatorNode.h>
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPlug.h>
#include <maya/MDataBlock.h>
#include <maya/MDataHandle.h>
#include <maya/MColor.h>
#include <maya/M3dView.h>
#include <maya/MFnPlugin.h>
#include <maya/MFnNumericAttribute.h>
#include "arrowData.h"
{
public:
curvedArrows();
~curvedArrows() override;
static void * creator();
static MObject aEnableTransparencySort;
public:
};
MTypeId curvedArrows::id( 0x08102B );
MObject curvedArrows::aEnableTransparencySort;
MObject curvedArrows::aEnableDrawLast;
MObject curvedArrows::aTransparency;
curvedArrows::curvedArrows() {}
curvedArrows::~curvedArrows() {}
void
curvedArrows::postConstructor()
{
}
{
return MS::kUnknownParameter;
}
{
glPushAttrib( GL_CURRENT_BIT );
} else {
}
glBegin( GL_LINE_LOOP );
unsigned int i;
for ( i = 0; i < fsEdgeLoopSize; i ++ ) {
glVertex3d( fsVertexList[fsEdgeLoop[i]][0],
fsVertexList[fsEdgeLoop[i]][1],
fsVertexList[fsEdgeLoop[i]][2]);
}
glEnd();
glPopAttrib();
}
{
float r, g, b, a;
data.getData( r, g, b );
glPushAttrib( GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT |
GL_PIXEL_MODE_BIT );
if ( a < 1.0f ) {
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
}
glColor4f( r, g, b, a );
glBegin( GL_TRIANGLES );
unsigned int i;
for ( i = 0; i < fsFaceListSize; i ++ ) {
unsigned int *vid = fsFaceList[i];
unsigned int *nid = fsFaceVertexNormalList[i];
for ( unsigned int j = 0; j < 3; j ++ ) {
glNormal3d( fsNormalList[nid[j]-1][0],
fsNormalList[nid[j]-1][1],
fsNormalList[nid[j]-1][2] );
glVertex3d( fsVertexList[vid[j]-1][0],
fsVertexList[vid[j]-1][1],
fsVertexList[vid[j]-1][2] );
}
}
glEnd();
glPopAttrib();
drawEdgeLoop( view, status );
} else {
drawEdgeLoop( view, status );
}
}
bool curvedArrows::isTransparent( ) const
{
MPlug plug( thisNode, aEnableTransparencySort );
bool value;
plug.getValue( value );
return value;
}
bool curvedArrows::drawLast() const
{
MPlug plug( thisNode, aEnableDrawLast );
bool value;
plug.getValue( value );
return value;
}
bool curvedArrows::isBounded() const
{
return true;
}
{
unsigned int i;
for ( i = 0; i < fsVertexListSize; i ++ ) {
double *pt = fsVertexList[i];
}
return bbox;
}
void* curvedArrows::creator()
{
return new curvedArrows();
}
{
aEnableTransparencySort =
aEnableDrawLast =
MStatus stat1, stat2, stat3, stat4;
stat1 = addAttribute( aTheColor );
stat2 = addAttribute( aEnableTransparencySort );
stat3 = addAttribute( aEnableDrawLast );
stat4 = addAttribute( aTransparency );
if ( !stat1 || !stat2 || !stat3 || !stat4) {
return MS::kFailure;
}
return MS::kSuccess;
}
{
MFnPlugin plugin( obj, PLUGIN_COMPANY,
"6.0",
"Any");
status = plugin.registerNode( "curvedArrows", curvedArrows::id,
&curvedArrows::creator, &curvedArrows::initialize,
if (!status) {
status.
perror(
"registerNode");
return status;
}
return status;
}
{
status = plugin.deregisterNode( curvedArrows::id );
if (!status) {
status.
perror(
"deregisterNode");
return status;
}
return status;
}