|
I’m writing an exporter, and I use Maya’s API to read Mesh data. When I export a mesh, my code looks like this :
MFnMesh mmesh(dagPath);
instance = 0;
if (dagPath.isInstanced())
instance = dagPath.instanceNumber();
if (! mmesh.getConnectedSetsAndMembers(instance, sets, comps, true))
return;
shaderCount = sets.length();
After that, I use a MItMeshPolygon to read the faces informations associated with each shading group . When I export a mesh with a single shader assigned to the whole object, the shaderCount variable is set to 1, and the export works correctly. But whenever I assign to some faces a different shader, so that my mesh have 2 or more different shading group, the shaderCount is always set to 0.
Has anybody encountered this problem, and is there a solution, or is my code wrong ?
Thanks
|
|
|