Cronholio
08-25-2009, 08:00 PM
Working on an exporter here. I'm writing to xml, and the way I want to format the data is for each object to have it's material list, and for each material to contain it's face list. The problem is that according to the documetation and every example I've seen you do this by getting the object's material, then marching through the face list and matching the material ID of the face to the material ID of the mesh material. It works fine if you have a single material assigned to the mesh or a single multi material assigned. I'm running into a problem where I have multiple standard materials and multi materials assigned to a single object and it makes the material IDs useless.
Say for example I have a sphere. Half the faces use a standard material and half have a multi material. It has two material IDs, 1 and 2. Material ID 2 points to a multimaterial that has 9 sub materials, I cannot determine which of those 9 materials are assigned to a particular face.
Any help? Is there any way to find the absolute material assigned to a face regardless of how far it may be buried in a multi material tree.
Say for example I have a sphere. Half the faces use a standard material and half have a multi material. It has two material IDs, 1 and 2. Material ID 2 points to a multimaterial that has 9 sub materials, I cannot determine which of those 9 materials are assigned to a particular face.
Any help? Is there any way to find the absolute material assigned to a face regardless of how far it may be buried in a multi material tree.
