iqmmodel plugin does not read texture path from model
I recently imported the iqmmodel
plugin from aaradiant (see !62 (merged)) but if the plugin works well, it currently does not read the texture paths from the model:
As you see the models mesh are correctly rendered, but not the texture.
In fact that part is still not done, instead the texture path is initialized with an empty string:
surface.setShader("");
If I hardcode an arbitrary texture for an arbitrary model the model is correctly textured so it means the plug-in just lacks the code to get that texture path from the iqm file:
The iqm specification is there, the interesting part is the iqmmesh
part:
// all data is little endian
struct iqmheader
{
char magic[16]; // the string "INTERQUAKEMODEL\0", 0 terminated
uint version; // must be version 2
uint filesize;
uint flags;
uint num_text, ofs_text;
uint num_meshes, ofs_meshes;
uint num_vertexarrays, num_vertexes, ofs_vertexarrays;
uint num_triangles, ofs_triangles, ofs_adjacency;
uint num_joints, ofs_joints;
uint num_poses, ofs_poses;
uint num_anims, ofs_anims;
uint num_frames, num_framechannels, ofs_frames, ofs_bounds;
uint num_comment, ofs_comment;
uint num_extensions, ofs_extensions; // these are stored as a linked list, not as a contiguous array
};
// ofs_* fields are relative to the beginning of the iqmheader struct
// ofs_* fields must be set to 0 when the particular data is empty
// ofs_* fields must be aligned to at least 4 byte boundaries
struct iqmmesh
{
uint name; // unique name for the mesh, if desired
uint material; // set to a name of a non-unique material or texture
uint first_vertex, num_vertexes;
uint first_triangle, num_triangles;
};
// all vertex array entries must ordered as defined below, if present
// i.e. position comes before normal comes before ... comes before custom
// where a format and size is given, this means models intended for portable use should use these
// an IQM implementation is not required to honor any other format/size than those recommended
// however, it may support other format/size combinations for these types if it desires
enum // vertex array type
{
The current iqmmodel
plugin reads the iqmheader
and the vertex array
but do nothing with the iqmmesh
struct.