Thanks David,
Here is what I have:
you can download it here:
bmaxbook.com/
The purpose of this was to export a model with multiple UV sets
from 3DS MAX 8 using the .egg exporter. The .egg exporter is very well written
but does not support multiple UV sets (hopefully it will in the future).
To get around this limitation, I created 2 identical models (lightmap.egg and Detail.egg)
and manually edited the .egg files to create a 3rd .egg file (combined.egg). Like you mentioned, for this to work the vertices need to be identical (which is not a problem for a lightmapped level)
3DS max exporter does not identify a uv-name. since there is only one, it is the default and
looks like this for each vertex:
<UV> { 1.03995 1.04513 }
you can see this in the “lightmap.egg” or “detail.egg” file that was generated by the 3DS
Max 8 .egg exporter.
the maya exporter handles multple UV Sets and each texture will have something
like this:
<Scalar> uv-name { detailUV }
I added these manually to “combined.egg”
<Scalar> uv-name { lightmapUV }
in addition, each vertex needs to know what the UV coordinates are for each
named set:
<UV> detailUV { -1.13374 -1.15105 }
<UV> lightmapUV { 0.280204 0.280204 }
In addition, every polygon needs to know about the textures that will be applied
to it (note there are 2 TRef’s per poly, one is the lightmap-Tex66 and
the other is the detail texture (Tex9,19 or 1 in this example):
<Polygon> {
<RGBA> { 1 1 1 1 }
<TRef> { Tex19 }
<TRef> { Tex66 }
<VertexRef> { 34 35 32 <Ref> { mymesh.verts } }
now i need to come up with a programmatic way to edit these files, as David
mentioned, once the .egg is loaded, the order of the vertices is unpredictable
so these changes need to happen to the file directly.
OR…
The 3DS MAx exporter can be modified to support multiple UV sets