Hi! We use the mesh format to determine the extents of meshes (in order to automatically scale them down to fit within certain boundaries, since they’re dynamically inserted by players through SpecialMesh instances), but are now unable to do this for newly uploaded meshes since the new format is not documented anywhere (whereas it was previously documented at Documentation - Roblox Creator Hub) o-:
Would it be possible to post a (maybe not even guaranteed to always be up-to-date) copy of the current version’s structure?
I wrote the Roblox Mesh Format article while I was at Roblox, so I’ll describe the changes here.
The changes to the format are actually quite minor.
Firstly, here are the changes to the MeshHeader:
struct MeshHeader
{
short sizeof_MeshHeader;
short sizeof_MeshVertex;
short sizeof_MeshFace;
[+] short sizeof_MeshLOD;
[+] short numLODs;
short numVerts;
short numFaces;
}
After reading the faces of the mesh file, there will be (numLODs * 4) bytes at the end of the file, representing an array of numLODs ints, or just:
int mesh_LODs[numLODs];
The array uses integers because sizeof_MeshLOD should always have a value of 4 to be considered valid.
The mesh_LODs array represents a series of face ranges, the faces of which form meshes that can be used at various distances by Roblox’s mesh rendering system.
For example, you might have an array that looks like this:
{ 0, 1820, 2672, 3045 }
This values in this array are interpreted as follows:
The Main mesh is formed using faces [0 - 1819]
The 1st LOD mesh is formed using faces [1820 - 2671]
The 2nd LOD mesh is formed using faces [2672 - 3044]
All of these faces should be stored in whatever array of MeshFaces you have defined.
I’m not 100% sure if I got this correct, but I did test it carefully and it seems to check out. @wgeom might be able to verify the details are correct here.