#include <assert.h>
#include <maya/MGlobal.h>
#include <maya/MString.h>
#include <maya/MPoint.h>
#include <maya/MVector.h>
#include <maya/MVectorArray.h>
#include <maya/MDoubleArray.h>
#include <maya/MArgList.h>
#include <maya/MFnDependencyNode.h>
#include <maya/MSelectionList.h>
#include <maya/MPxCommand.h>
#include <maya/MFnDagNode.h>
#include <maya/MRenderLine.h>
#include <maya/MRenderLineArray.h>
#include <maya/MFnPfxGeometry.h>
#include <maya/MFnPlugin.h>
#define mCommandName "pfxInfo" // Command name
{
public:
pfxInfoCmd();
virtual ~pfxInfoCmd();
static void* creator();
private:
};
pfxInfoCmd::pfxInfoCmd()
{
}
pfxInfoCmd::~pfxInfoCmd()
{
}
{
{
}
}
{
pfxOutput = "none";
{
}
{
}
{
}
pfxOutput = "all";
} else {
{
}
}
nodeFromName( pfxName, pfxNode );
if( pfxNode.isNull() )
{
}
{
}
}
{
int i;
char buffer[256];
sprintf( buffer, " %s(%d entries):", title, len);
for( i = 0; i < len; i++ ){
sprintf( buffer, " %f", array[i]);
}
}
{
int i;
char buffer[256];
sprintf( buffer, " %s(%d entries):", title, len);
for( i = 0; i < len; i++ ){
sprintf( buffer,
" (%f, %f, %f)", vec.
x, vec.
y, vec.
z);
}
}
{
printVectorArray( line, "line" );
}
printVectorArray( twist, "twist" );
}
printDoubleArray( width, "width" );
}
printDoubleArray( flatness, "flatness" );
}
printDoubleArray( parameter, "parameter" );
}
printVectorArray( color, "color" );
}
if( incandescence.
length() > 0 ){
printVectorArray( incandescence, "incandescence" );
}
if( transparency.
length() > 0 ){
printVectorArray( transparency, "transparency" );
}
}
{
char buffer[256];
int length = lineArray.
length();
sprintf( buffer, "=%s (%d lines) =============================================", title, length);
for( int i = 0; i < length; i++ ){
sprintf( buffer, " LINE %d .......................", (i+1));
printRenderLine( renderLine );
}
}
}
{
return stat;
}
if( pfxOutput == "none" ){
return stat;
}
if( pfxOutput == "all" ){
stat = node.getLineData( mainLines, leafLines, flowerLines,
true, true, true, true,
true, true, true, true, true );
} else if( pfxOutput == "line" ){
stat = node.getLineData( mainLines, leafLines, flowerLines,
true, false, false, false,
false, false, false, false, true );
} else if( pfxOutput == "lineAndWidth" ){
stat = node.getLineData( mainLines, leafLines, flowerLines,
true, false, true, false,
false, false, false, false, true );
}
return stat;
}
stat = printRenderLineArray( mainLines, "MainLines" );
return stat;
}
stat = printRenderLineArray( leafLines, "LeafLines" );
return stat;
}
stat = printRenderLineArray( flowerLines, "FlowerLines" );
return stat;
}
}
void * pfxInfoCmd::creator() { return new pfxInfoCmd(); }
{
MFnPlugin plugin( obj, PLUGIN_COMPANY,
"6.5",
"Any");
MStatus status = plugin.registerCommand(mCommandName,
pfxInfoCmd::creator );
if (!status)
status.
perror(
"registerCommand");
return status;
}
{
MStatus status = plugin.deregisterCommand(mCommandName);
if (!status)
status.
perror(
"deregisterCommand");
return status;
}