Search code examples
3dfbxassimp

How can I get texture file by using assimp?


I am developing FBX model viewer using directx and assimp library. For loading texture, I called function like below. (I got FBX from mixamo)

aiString path;
mat->Get(AI_MATKEY_TEXTURE_DIFFUSE(0), path); // mat is aiMaterial*

The "path" variable now has "../../../../home/app/mixamo-mini/tmp/skins_XXX.fbm/Mutant_Diffuse.png"

I cannot find that path on my computer from the location where FBX file exists. I use Windows 11 Pro. How can I read the texture files Assimp extracted ? Even "../../../../home" does not exist.


Solution

  • This is not an Asspmp-Problem because the library will just read the texture information provided by your model.

    This is a relative path description which was written by the Modeller when writing the model onto disk. The referenced texture was located at ../../../../home/app/mixamo-mini/tmp/skins_XXX.fbm/.

    I guess you need to look for the textures by yourself and adapt the path description for the texture by yourself.