#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();
~pfxInfoCmd() override;
static void* creator();
private:
};
pfxInfoCmd::pfxInfoCmd()
{
}
pfxInfoCmd::~pfxInfoCmd()
{
}
{
{
return MS::kSuccess;
}
return MS::kFailure;
}
{
pfxOutput = "none";
{
return MS::kFailure;
}
{
return MS::kFailure;
}
if (stat != MS::kSuccess)
{
return MS::kFailure;
}
pfxOutput = "all";
} else {
if (stat != MS::kSuccess)
{
return MS::kFailure;
}
}
nodeFromName( pfxName, pfxNode );
if( pfxNode.isNull() )
{
return MS::kFailure;
}
{
return MS::kFailure;
}
return MS::kSuccess;
}
{
int i;
char buffer[256];
sprintf( buffer, " %s(%d entries):", title, len);
for( i = 0; i < len; i++ ){
sprintf( buffer, " %f", array[i]);
}
return MS::kSuccess;
}
{
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);
}
return MS::kSuccess;
}
{
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" );
}
return MS::kSuccess;
}
{
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));
if( stat == MS::kSuccess ){
printRenderLine( renderLine );
}
}
return MS::kSuccess;
}
{
if( stat != MS::kSuccess ) {
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 );
}
if( stat != MS::kSuccess ){
return stat;
}
stat = printRenderLineArray( mainLines, "MainLines" );
if( stat != MS::kSuccess ){
return stat;
}
stat = printRenderLineArray( leafLines, "LeafLines" );
if( stat != MS::kSuccess ){
return stat;
}
stat = printRenderLineArray( flowerLines, "FlowerLines" );
if( stat != MS::kSuccess ){
return stat;
}
return MS::kSuccess;
}
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;
}