#include <maya/MIOStream.h>
#include <maya/MGlobal.h>
#include <maya/MPlugArray.h>
#include <maya/MFnDagNode.h>
#include <maya/MObjectArray.h>
#include "hwPhongShaderBehavior.h"
#define VERBOSE 0
hwPhongShaderBehavior::hwPhongShaderBehavior()
{
}
hwPhongShaderBehavior::~hwPhongShaderBehavior()
{
}
void *hwPhongShaderBehavior::creator()
{
return new hwPhongShaderBehavior;
}
bool hwPhongShaderBehavior::shouldBeUsedFor(
{
bool result = false;
result = true;
#if VERBOSE
<< (result?" true\n":" false\n");
#endif
return result;
}
bool force)
{
{
if (force) cmd += "-f ";
cmd += srcPlug.
name() +
" " + destPlug.
name();
#if VERBOSE
#endif
}
return result;
}
MStatus hwPhongShaderBehavior::connectNodeToNode(
bool force )
{
if ((src.typeName() == "hwPhongShader") &&
{
result = connectAttr(src.findPlug("outColor"),
dest.findPlug("hardwareShader"), force);
}
#if VERBOSE
if (result != MS::kSuccess)
cerr << "connectNodeToNode "<<src.name().asChar()
<< " failed\n";
#endif
return result;
}
MStatus hwPhongShaderBehavior::connectNodeToAttr(
bool force )
{
if ((src.typeName() == "hwPhongShader") &&
{
result = connectAttr(src.findPlug("outColor"), destinationPlug, force);
}
#if VERBOSE
if (result != MS::kSuccess)
cerr << "connectNodeToAttr "<<src.name().asChar()
<< " failed\n";
#endif
return result;
}
MStatus hwPhongShaderBehavior::connectAttrToNode(
bool force )
{
if ((src.typeName() == "hwPhongShader") &&
{
result = connectAttr(sourcePlug, dest.findPlug("hardwareShader"),
force);
}
#if VERBOSE
if (result != MS::kSuccess)
cerr <<
"connectNodeAttrToNode "<<sourcePlug.
name().
asChar()
<< " failed\n";
#endif
return result;
}
MStatus hwPhongShaderBehavior::connectAttrToAttr(
bool force )
{
#if VERBOSE
cerr <<
"In connectAttrToAttr "<<sourcePlug.
name().
asChar()
<< "\n";
#endif
return connectAttr(sourcePlug, destinationPlug, force);
}