XNA: Retrieve texture file name during runtime
Posted
by
townsean
on Game Development
See other posts from Game Development
or by townsean
Published on 2011-06-02T13:31:22Z
Indexed on
2011/11/30
2:08 UTC
Read the original article
Hit count: 220
I'm trying to retrieve the names of the texture files (or their locations) on a mesh.
I realize that the texture file name information is not preserved when the model is loaded.
I've been doing tons of searching and some experimenting but I've been met with no luck. I've gathered that I need to extended the content pipeline and store the file location in somewhere like ModelMeshPart.Tag.
My problem is, even when I'm trying to make my own custom processor, I still can't figure out where the texture file name is. :(
Any thoughts? Thanks!
UPDATE:
Okay, so I found something kind of promising. NodeContent.Identity.SourceFilename, only that returns the location of my .X model. When I go down the node tree he is always null. Then there's the ContentItem.Name property. It seems to have names of my mesh, but not my actual texture file names. :(
© Game Development or respective owner