|
Currently I have been able to find the “color” node and “specularColor” node on a surfaceShader, howver I am having trouble finding the normal map. I look for the “color” and “specularColor” like so:
// look for files linked to this mesh
MStatus stat;
MFnDependencyNode typeDepNode(materialNode) // the surfaceShader node
MPlug typePlug = typeDepNode.findPlug(MString("specularColor"), &stat) // the type
if(stat)
{
MPlugArray typePlugArray;
typePlug.connectedTo(typePlugArray, true, false)
if(typePlugArray.length() > 0)
{
MObject colorNode = typePlugArray[0].node() // misleading name, but this would be the node I found
if(colorNode.hasFn(MFn::kFileTexture))
{
MFnDependencyNode fileNode(colorNode)
MPlug filePlug = fileNode.findPlug("fileTextureName", &stat) // look for the "fileTextureName" attribute.
if(stat)
{
MString fileTextureName;
filePlug.getValue(fileTextureName)
MStringArray splitName;
fileTextureName.split('/', splitName)
sprintf_s(aOut, OMDL_STRSIZE, splitName[splitName.length()-1].asChar())
}
}
}
}
Now, how do I go about that when finding a normal map? I tried looking for the following nodes: “bump2d”, “bumpValue”, “normalMap”, “cameraNormal”. But none result in anything.
Please help, this is severely limiting my exporter’s development.
|
|
|