I have built an importer that retrieves necessary vertex data however I wish to be able to read texture file directories. How do I retrieve the texture file name?


FBX supports a whole range of texture properties per surface material: diffuse, specular, etc.. The property names are stored in static char* fields in SDK classs FbxSurfaceMaterial. You can get a pointer to such a material by iterating across all materials of an FbxNode using functions GetMaterialCount() and GetMaterial(index).

To load a texture, you first have to retrieve a valid FbxProperty from the FbxSurfaceMaterial by querying it with FindProperty(propertyName), then iterate over the number of "SrcObjects" using GetSrcObjectCount() and GetSrcObject() and for each of them retrieve the user data with GetUserDataPtr(). This user data contains the name of the texture. How you map that to your filesystem/packed data/ is up to you.

Keep in mind that most of the properties also have associated factor properties, and they can be queried with their associated names in exactly the same way. The factors are typically used to set material property weights in the lighting shader (such as specular, reflectiveness, ambient, emissive etc.. )

| improve this answer | |
  • 2
    \$\begingroup\$ Cheers! The SDK can be so damn confusing. \$\endgroup\$ – Tyson May Oct 26 '14 at 0:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.