|
Hi evryone,
i want to extract the material properties that are in a mesh. i am catching the node with the mesh attribute then i do not understand how to extract the material properties from
the layer material. can some one gives to me the steps to arrive to the material properties.
|
|
|
|
Please refer to the DisplayMaterial(KFbxGeometry* pGeometry) in ImportScene example.
Basically, you can get the material from the node like this:
for(int lIndex=0; lIndex < lNode->GetMaterialCount() lIndex++)
{
KFbxSurfaceMaterial *lMaterial = lNode->GetMaterial(lIndex)
//Then for each lMaterial, you can get the property from it according to its type.
if(lMaterial->GetClassId().Is(KFbxSurfaceLambert::ClassId) )
{
((KFbxSurfaceLambert *)lMaterial)->GetAmbientColor()
((KFbxSurfaceLambert *)lMaterial)->GetDiffuseColor()
...
}
else if(lMaterial->GetClassId().Is(KFbxSurfacePhong::ClassId))
{
((KFbxSurfacePhong *) lMaterial)->GetAmbientColor()
((KFbxSurfacePhong *) lMaterial)->GetDiffuseColor()
...
}
}
Jiayang Xu - Autodesk FBX
|
|
|