Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
I have an graphics engine capable of rendering 3D graphics, until a while ago I was using Blender to build some 3D models and testing some textures, and them exporting them as an OBJ file. I would get two files: the first one was a OBJ file with all the meshes data I would need, and the second one was a MTL file with some additional data which I found very useful, it would handle me the texture's file name that the current model I'm looking at uses, and even multiple texture's file names when I had a OBJ with multiple meshes. But now I've moved on to FBX files because of animations, and I don't know how to retrieve the texture name as I did in OBJ files because Blender only exports one file... If someone can help me find out how can I get the texture name from the FBX file that it's mesh uses it would be very helpful.
Hi,
the information is all inside the FBX file so, you have to read it completely in memory before you can query any data. After you have loaded the FBX file in memory, you are supposed to have an FbxScene object filled with all the data. At this point, if you just want all the textures names. you can do something like:
for (int i = 0, txCount = lScene->GetSrcObjectCount<FbxTexture>(); i < txCount; i++)
{
FbxTexture* lTex = lScene->GetSrcObject<FbxTexture>(i);
FbxString name = lText->GetName();
}
If you want to get the textures associated to a model, I strongly suggest you look at the ImportScene sample that is in the FBX SDK package. The work is slightly more complex because you have to get the material(s) from the geometries, then visit the material properties to find the FbxTexture objects connected.
Hope this helps
Can't find what you're looking for? Ask the community or share your knowledge.