How to extract mesh from a data stream?

272 Views Asked by At

For research purposes (not related to CG and I have no prior experience working with meshes), I'm using an open source program (3DWorld) which is part python and part Unity. only the python part is open source and the two are connected thru zmq. documentation says that the python api asks the Unity build to fetch meshes from an amazon server. So I have got this mesh data (lists of two items which are both bytes), but I don't know how to save it as fbx file. I contacted the devs and they responded that it's possible to extract the mesh data and convert it to FBX. Although they said that they haven't written the converter, and they just mentioned that I can do it and didn't mention how. Here I have a pickled list which is supposed to be a "aaa_battery": pickled list link

Please show me how to extract mesh from this list. I will appreciate any help.

1

There are 1 best solutions below

5
On

Only the first item from your list is probably useful. It has what I suppose to be vertex indices chunk and vertex data chunk. All integers seem to be little endian.

Vertex indices chunk starts with its size at 0x3c and the actual data starting at 0x40. Indices come in triplets of 4-byte integer values.

Vertex data chunk starts with its size at 0x4ed0 and the data starting at 0x4ed4. 12 bytes for each vertex, probably 3 floats for X, Y and Z.

I am not sure if this is some well known format but it looks pretty straightforward, should be easy to write a converter even if you wouldn't be able to figure out what's it called.