Skinned MeshPart Studio Beta

If I’m allowed to ask, what changes were made to the mesh format between Avatar Evolution and now? I’ve been working on a reverse engineered spec of the format for people making 3rd party extensions.

Although I don’t have it 100% accurate yet, I was able to figure out enough of it to where I could reliably read all of its data.

Currently I have the following pseudo-header spec:

// version 4.00
// Additional types are defined below.

struct Mesh
{
    MeshHeader header;
    
    Vertex[numVerts] verts;
    Envelope[numVerts] envelopes;
    
    Face[numFaces] faces;
    int[numLODs] lods;
    
    Bone[numBones] bones;
    byte[nameTableSize] nameTable;
    
    SkinData[numSkinData] skinData;
}

struct MeshHeader
{
    short sizeof_MeshHeader;
    
    short numMeshes;
    int   numVerts;
    int   numFaces;
    
    short numLODs;
    short numBones;
    
    int   nameTableSize;
    int   numSkinData;
}

struct Vertex
{
   float px, py, pz;
   float nx, ny, nz;
   float tu, tv, tw;
   byte  r, g, b, a;
}

struct Envelope
{
    byte bones[4];    // [citation needed]
    byte weights[4];  // [citation needed]
}

struct Face
{
    uint a, b, c;
}

struct Bone
{
    int nameTableIndex;
    short id;      // [citation needed]
    
    short parent;
    float unknown; // [stub]
    
    float r00, r01, r02;
    float r10, r11, r12;
    float r20, r21, r22;
    
    float x, y, z;
}

byte[nameTableSize] nameTable;

struct SkinData
{
    int facesBegin;
    int facesLength;
    
    int vertsBegin;
    int vertsLength;
    
    int numBoneIndices;
    short boneIndices[23];
}

The actual spec I wrote can be found here:

(cc @RobieTheCat)

8 Likes