#include <maya/MIOStream.h>
#include <maya/MSimple.h>
#include <maya/MString.h>
#include <maya/MFnMesh.h>
#include <maya/MFnSet.h>
#include <maya/MItDependencyGraph.h>
#include <maya/MItMeshPolygon.h>
#include <maya/MSelectionList.h>
#include <maya/MGlobal.h>
#include <maya/MDagPath.h>
#include <maya/MObjectArray.h>
#include <maya/MPlug.h>
{
bool asSrc = false;
bool asDst = true;
shaderPlug.
connectedTo( connectedPlugs, asDst, asSrc );
if (connectedPlugs.
length() != 1)
cerr << "Error getting shader\n";
else
return connectedPlugs[0].node();
}
}
{
int instanceNum = 0;
if (!fnMesh.getConnectedSetsAndMembers(instanceNum, sets, comps, true))
cerr << "ERROR: MFnMesh::getConnectedSetsAndMembers\n";
for (
unsigned i=0; i<sets.
length(); i++ ) {
if (status == MS::kFailure) {
cerr << "ERROR: MFnSet::MFnSet\n";
continue;
}
if ((status == MS::kFailure) || comp.
isNull())
continue;
MObject shaderNode = findShader(set);
continue;
if (status == MS::kFailure)
continue;
&status);
if (status == MS::kFailure)
continue;
dgIt.disablePruningOnFilter();
if (dgIt.isDone())
continue;
MObject textureNode = dgIt.currentItem();
cerr << "Set: " << fnSet.name() << endl;
cerr <<
"Texture File Name: " << textureName.
asChar() << endl;
for ( ; !piter.isDone(); piter.next() )
cerr << " poly component: " << piter.index() << endl;
}
return MS::kSuccess;
}