.MDD file exporter / importer source code (C / C++)

Intro

 C / C++ code for MDD file format exporter ]. (I tested my exported .mdd files by loading them with blender's mdd file importer.)

MDD stands for Motion Designer Document and is sometimes refered as the Lightwave Point Cache file format. It's a file format that allows to save an animated mesh as a sequence of vertex coordinates for each frame. The file basically stores a snapshot of every mesh vertices for each frame which you can easily replay in softwares like Blender, Maya etc. So it caches the points of a mesh at each frame. The file format originated from the Lightwave animation tool.

MDD file format specification

The MDD file format is in "Motorola Big Endian byte order" as opposed to the Intel Little Endian standard. So you must come up with an algorithm to flip the bytes during file IO. The data structure is like so:

typedef struct{
    int totalframes;
    int totalPoints;
    float *Times; //time for each frame
    float **points[3];
}mddstruct;

// Exporting:
totalframes
totalPoints
Times
while(!totalframes)
{
    while(!totalPoints)
    {
        write point[frame][point][axis];
        point++;
    }
    frame++;
}

Blender

To import / export .mdd files in blender make sure the addon is enable in the preference window:

To import / export .mdd files in blender make sure the addon is enable in the preference window:

References

No comments

(optional field, I won't disclose or spam but it's necessary to notify you if I respond to your comment)
All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Anti-spam question: