Need help to update an old maxscript to support multiple uv channels

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to update an old maxscript that used outdated commands to set up the uv map, however the model it was written for includes a lot of objects that use two uv channels.
Here's how it works:
Geometry data of every object is stored in blocks. All blocks have a header that includes type and block size, so the maxscript does this:
case type of (
0x01: (
triangle_strip f count matid
)
0x02: (
for i = 1 to count do (
append g.position (RH2LH([(readBEfloat f),(readBEfloat f),(readBEfloat f)]))
)
)
0x03: (
for i = 1 to count do (
append g.uv ([(readBEfloat f),1-(readBEfloat f),0])
)
)
The issue here is that objects that use two uv channels (and only those objects) have another uv block after the first one (eg. face->vertex->uv->uv).
Now to make things even more complicated, to build the object a bunch of outdated commands were used that, if I understand it correctly, just don't support saving to uv channel 2, example:
msh.numTVerts = g.uv.count
buildTVFaces msh
for j = 1 to g.uv.count do setTVert msh j g.uv[j]
for j = 1 to g.face.count do setTVFace msh j g.face[j]
I've been looking at the meshop general mapping methods but the commands there seem to work too differently to just replace the old commands with the new ones.
Any insight to how should I handle this?