Hey everyone! I have extended this to include a WIP specification for version 4.00 of Roblox’s mesh format. I still haven’t fully deciphered the purpose of all the data it stores, but I’ve got it down enough to where it can at least be read fully.
Check out the version 4.00 [WIP] section to learn more!
Let me know if you guys have any insights to things I left stubbed out or wasn’t sure about.
Um I have a question I gotta ask, Um how do you write the script mesh format 4.00 on the roblox studio?. Because I was trying to import a mesh the has like between 46k and 70k tris. And I was trying to figure out a way how to import them. But I don’t how to make a script for it to reduce it’s self. And I really need some help to learn how to do it.
This to me, seems to be incorrect, at least for 1.00 meshes. I wrote a parser for 1.x and 2/3 meshes, and whenever I invert the tex_V coord like mentioned here, textures look incorrect
From checking some of the S15_Lola V4.00 mesh files I have the following comments that may be useful.
The meshHeader field numSkinData is only 16 bits not 32 (and is followed by a 16 bit number set to 1 in mesh files used for S15_Lola)
There is no meshHeader field to define the number of Envelopes so it is the same as numVertices except when the numBones is zero when there are no Envelope structs in the file.
The SkinData struct appears to be an extension to the LOD data (the facesBegin and facesLength contain the same information).
The SkinData struct would appear to define a different section of the shared vertex and face array and to allow the mapping of bone indices to the bone array.
I’ve made a revision to the spec which accounts for the new tangent vector data, which is packed into the 4 bytes that were previously used for the UV’s dummied out tw Z-coordinate.
One last update to specify how the envelopes are tied to the mesh subsets and to clear the last 2 undefined bytes in the MeshHeader. The version 4.00 spec should be 100% complete now!
Have updated this with a WIP spec for version 5.00! I think I figured out most of it, but still need to do some experiments to make sure I’m covering it all correctly.
At the very least it should be trivial to read the data into a structure that fits the data
Thats very kind of you to keep this up to date even after 3 years. Also, I was wondering if there are any decoders for v4 and 5 meshes?
[EDIT] : It is actually possible to download meshes directly in the .OBJ (only face, vertices and uv data) format by using https://thumbnails.roblox.com/v1/assets-thumbnail-3d?assetId=AssetId
This will return an URL under ‘imageUrl’ field which will return the URL for the .OBJ object under ‘obj’ field.
I’m pretty sure you can upload the meshes directly through the mesh upload API if you have the mesh already converted to this format, I haven’t tested it fully though
You could also load in the mesh using PromptImportFile or local content paths but these have their own problems (mainly asset caching)
I’ve made some final amendments and corrections to version 5.00 and made a placeholder section for version 6.00, which isn’t being used in practice yet but does exist.
I can now say I’m 100% confident in my spec for version 5.00 and have implemented it in practice!
I have a reader for the mesh format fully implemented in --!strict Luau here if anyone is looking for a reference: