Jump to content
  • Advertisement
Sign in to follow this  

Obtaining Texture Filename From Loaded FBX file

This topic is 3305 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been looking online for a long time to find the solution to this. I'm surprised that there is only one close solution﹕ http://www.ziggyware.com/readarticle.php?article_id=181 (The reason why I'm not using this solution is because I'm using XNA 3.1 and when I compile that code, it is using XNA.Framework 2.0 which I'm guessing isn't an available resource to add to the 3.1 architecture which contains only the framework for 3.0 and 3.1. Thus the project doesn't compile. I've tried rewriting it using 3.1 Libraries but certain libraries have been depricated or are unavailable? not sure) The problem is when you load a Model from an FBX file, the BasicEffects object contains the texture but the name property is blank. This means that I cannot access the textures dynamically to render but have to load each texture manually through importing and loading assets. Is the only way to get the texture filename to write your own custom content processor? I was looking at the TextureContent class to see if there is any way to extra the file name from a Texture2D or Effects object, but it seems that it is not stored in the object itself but rather has to be extracted from the FBX at load time? For a simple Model class. Getting an effects object is as simple as: Model myModel; //loading code... Effect firstEffect=myModel.Meshes[0].Effects[0]; BasicEffect b=(BasicEffect)firstEffect; But neither of these contain the filename. I need the file name so I can load it and pass it to the shader. This is so that my project can import fbx files with multiple textures instead of having to load each one in individually. Thank you for your help and input!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!