Introduction
This is the native model format of MilkShape 3D, a low-polygon modeller by Mete Ciragan (chUmbaLum sOft) that was widely used for making game models. A file holds a triangle mesh divided into groups, materials with texture file names, and a skeleton of joints with rotation and position keyframes. Textures stay in separate image files.
The author publishes the layout in the MilkShape 3D SDK as a C header-style text, and engines and libraries such as Assimp and Irrlicht load the format. Later versions of the program added optional blocks at the end of the file for comments, multiple bone weights per vertex, joint colours and display settings.
Structure
An MS3D file is binary, little-endian and packed with no padding. It starts with the
ten characters MS3D000000 and the version number 4. There are no
offsets: each list follows the one before it, with a count in front.
0HeaderMS3D000000, version 414 bytes14Vertices position and bone15 bytes each…Triangles indices, normals, texture coordinates70 bytes each…Groups name, triangle list, materialvaries…Materials colours and texture names361 bytes each…Animation settings and joints keyframesvaries…Optional blocks comments, vertex weights, joint and model extrasvaries
In the explorer
A dropped .ms3d file shows every structure and field in the byte tree,
the optional blocks included. The model is drawn in 3D with every triangle, each group
lit with its material’s ambient, diffuse, specular and emissive colours and its
shininess, and the skeleton in a view of its own with the stored joint colours; where
there are keyframes both can be played, and every key and frame opens as a pose. The
format does not define what lies between two keys: the viewer turns and moves
evenly.
Texture and alpha map pictures are separate files. Their names are always shown; when the model is opened from a folder that holds them (PNG, JPEG, TGA, PPM or PGM, or uncompressed BMP) they are applied with the triangles’ s and t coordinates, the grey of an alpha map giving the opacity. Transparent materials follow the model extra block: plain blending, blending that keeps depth above the alpha reference, or triangles sorted by depth. The joint size, a setting of the editor with no stated unit, is shown and not used.
Tables list the vertices with their joints and weights, the triangles, groups, materials, joints, keys and comments. Files up to 256 MB are read, and picture files up to 512 MB; a PNG or TGA picture above 134,217,728 pixels is sampled down to that size.
In this reference
- File layout – every structure and flag, the four optional blocks and their versions, vertex weights, how joints transform the mesh, a worked example and where readers differ
Links
Software
- MilkShape 3D – the modeller that defines the format (Windows)
- Maverick Model 3D – open-source model editor that imports and exports MS3D
Developers
- Assimp – library that imports MS3D among many 3D formats (C++)
- Irrlicht – 3D engine with an MS3D skinned-mesh loader (C++)
- ms3d crate – MS3D reader (Rust)
Reference
- ms3dspec.txt.c – the MilkShape 3D 1.8.2 File Format Specification by Mete Ciragan, as shipped in the SDK
- Assimp MS3DLoader.cpp – an open-source reader
- Maverick Model 3D: MS3D export options – what the versions of the vertex block hold
- Paul Bourke: MilkShape 3D format – a description of the basic layout