Community
for (int i = 0; i < pMesh->GetLayerCount(); i++)
{
KFbxLayer * pLayer = pMesh->GetLayer(i);
if (pLayer == NULL)
continue;
KFbxLayerElementMaterial* pMaterialLayer = pLayer->GetMaterials();
if (pMaterialLayer == NULL)
return S_OK;
KFbxLayerElement::EMappingMode mappingMode = pMaterialLayer->GetMappingMode();
if (mappingMode == KFbxLayerElement::eBY_POLYGON )
{
if (pMaterialLayer->GetReferenceMode() == KFbxLayerElement::eINDEX ||
pMaterialLayer->GetReferenceMode() == KFbxLayerElement::eINDEX_TO_DIRECT)
{
int i;
int* lMaterialIndices = pMaterialLayer->GetIndexArray().GetArray();
int lMaterialIndexCount = pMaterialLayer->GetIndexArray().GetCount();
for (i = 0; i < lMaterialIndexCount; i++)
{
int matID = lMaterialIndices ;
per_polygon_material = matID;
}
....
Can't find what you're looking for? Ask the community or share your knowledge.