True. I will take a closer look at pt2's optimize function to see what it does and how big the impact is on the 'cleanness' of the model and the file-size. We might be able to do this in max as well, but I have my doubts.Well I'm afraid using PT2 for its optimize function can still be critical in some cases. And applying this function can also change the vertices IDs...
I thought that 3dsmax supports multiple texture-vertices per model-vertex, while Carmageddon does not. The optimize function suggests otherwise, so that might change the whole way the script currently looks at things. The solution might also be in just exporting the model in a different way.
Can you tell me in what cases the optimize function was critical for you?
Ok, a little investigating this morning makes me believe that the texture vertices and model vertices are indeed directly linked, but can be reduced by the optimize function as vertices can be re-used for multiple faces. I think what the PT2 optimize function does is search along the texture-vertices for identical ones and then removes the duplicates and rewrites the references internally. Here are some shots. I have used ADR's 64PU as an example, specifically the wheels:
In the first shot you can see the un-optimized vertexcount in pt2:
We can see the same thing in 3ds max These texture-vertices (or map-vertices) hold the x,y coordinates of the vertex in texture space. The actual model-vertices, the ones in 3d space with x,y,z coordinates, are 40. Multiply this by 3, as each face has 3 vertices, and you get 120 vertices. That indeed is very un-optimized!?!?!
Finally, after the using the optimize funtion you can see the number of vertices is reduced to almost half:
My first guess would be to start looking for identical map/texture vertices in 3ds max and re-write the exporter so that it will not generate duplicates. I think my initial guess was right; Carmageddon cannot have multiple texture-vertices per model-vertices. But it can re-use the same vertex multiple times.
Does that make sense?