Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / SDK / getConnectedSetsAndMembers returns empty list when 2 or more shaders are assigned to an object
  RSS 2.0 ATOM  

getConnectedSetsAndMembers returns empty list when 2 or more shaders are assigned to an object
Rate this thread
 
59695
 
Permlink of this thread  
avatar
  • XGouchet
  • Posted: 04 September 2011 11:48 PM
  • Total Posts: 1
  • Joined: 04 September 2011 11:40 PM

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(instancesetscompstrue))
   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



Replies: 0