One common use for a mesh having multiple UV maps is when combining several
mesh objects into one: the base UV map is the result of joining the meshes
(and will be a right mess of overlapping UV islands), but an additional UV
map is then setup as a copy of the first but with the islands re-packed so
nothing overlaps. The export script now searches for the active UV map and
uses that for both UV coordinates and the skin texture (when none is
specified).
If there's no export script, or the export script has no frame information,
animation data will be collected by running through blender frames 1 to the
current frame (inclusive). Each frame will be exported as a single frame
rather than as members of a frame group.
I'd forgotten I hadn't implemented exporting vertex normals. While I've
modified things for making better use of blender's tools and avoiding the
unnecessary use of objects, the code is taken from the ajmdl blender 2.4
export script.
Not sure if it actually works as the clients don't render the result
properly (can't see anything where the model should be), but the output
model does import back into blender properly.
Eye position, auto rotation, sync type and particle effects can now all be
edited in blender: both import and export do the right thing. The settings
can be found in the "QF MDL" panel of the "Object" tab of the properties
view.
The params are eye position, flags and synctype. Provision is made for
reading them from a text block on export, but nothing is done other than
retrieving the text block.
The biggest part of the speedup is reading from blender's image only once
(it seems that every read does so from GL rather than memory: ouch). Also,
cache the results for each color.
The size is actually the average area in quake units of the mesh's
triangles. Again, my results are slightly smaller (0.025).
With this, all calculable fields are set. Only eye position, flags and
synctype remain.
The calculated radius is a smidge (0.05) smaller than the original
(invisibl.mdl), but I think that's due to the difference in source data: id
used the original models, I'm using their output.
I /did/ see the warning about vertex index 0 in the obj importer script,
but I didn't take it seriously enough. This fixes both the twisted texture
on a couple of faces, and the truly mangled tris when exporting (using
invisibl.mdl for testing).
There seems to be some problems with the UVs, only one frame is exported,
and various model params don't get set (eye position, size, bounding
radius, synctype, flags), but the size and shape look right in qf :).