Exporting Multiple Materials

Hey guys. Last time I came here I got good help.

I’m working on a model format for a game I’m working on. So far, I can export multiple meshes, animation and a UV co-ordinates. I use a Python Script to do so, I then load it up in my C++/OpenGL game and it works fine.

Now, I need to know how I can export multiple materials, then be able to specify which material should be used on a faces UV co-ordinates. So far, I’ve worked out, that I can retrieve a materials index for each individual mesh then a index from each face as to which material it should use. I think this is what I want. Except, I don’t want 50 different materials lists for each mesh (we’re using the format for maps too), considering the artist is probably going to need to be able to specify the texture filename linked to a material (unless there is a way around this, like exporting the filename from blender). I need to be able to list each material, globally at the start, then each face references from that global list.

I’m sorry if this a really stupid question. The Blender Python Api documentation is pants. It’s rare to see such a well used program having such shoddy documentation!

Sorry, I don’t fully understand your question, but there is a way to export the image filenames used by the texture. You can see an example right at the top of this page.
So you could specify per face what image should be applied to it.