I was wondering if there is any way to export blender materials for md5 files so that ambient,diffuse, and specular colors can be applied to the loaded mesh. For object files, a .mtl file is generated and read in by ObjToJme. I looked at the md5 file format spec and it calls this a "shader" but it looks like only texture files are supported, and this is confirmed by Neakor's MD5Importer code as mesh parsing only assigns a texture file name for the shader token. The "marine.md5mesh" file in the MD5Importer project test code has the line
What is the "marine" resource, the path is not part of the project.
If materials are indeed not support and only textures, then I was thinking I could also export an object file which would produce a .mtl file with my materials and then add bogus textures like MTLTOKEN_[materialName] that are applied to the same mesh subsets as each material, so that I can then associate a material with each loaded MD5 mesh (since MD5 meshes don't have names) and then discard those textures that are invalid. If I need to apply a material and a valid texture to a mesh, then instead of using a bogus flag name like MTLTOKEN_xxx, I would give the material the same name as the texture.
Can anyone think of a better way?