Remember 3December
Find out where to celebrate your 3D CG art...
  • 1/3
You are here:Forum Home / Autodesk® FBX® / FBX SDK / how to extract material properties
  RSS 2.0 ATOM  

how to extract material properties
Rate this thread
 
36243
 
Subscribe to this thread
avatar
  • salvob
  • Posted: 02 November 2009 12:20 PM
  • Total Posts: 3
  • Joined: 2009-10-15 07:35:31

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.



Replies: 0
avatar
  • Location: Shanghai, PRC.
  • Total Posts: 45
  • Joined: 2008-11-12 13:59:49

Please refer to the DisplayMaterial(KFbxGeometry* pGeometry) in ImportScene example.
Basically, you can get the material from the node like this:

for(int lIndex=0lIndex 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

Replies: 0




   
  Settings Choose Theme color: