Introduction
SMD is the text source format for Valve’s game models. Artists export meshes and
animations from their modelling program as SMD files, and Valve’s
studiomdl compiler, driven by a .qc script, turns them into
the studio model a Half-Life or Source engine
game loads. Decompilers also produce SMD files from existing models.
The same format holds two kinds of file: a reference mesh, with a skeleton in its rest pose and the triangles skinned to it, and an animation, with the skeleton’s pose on each frame and no triangles.
Structure
An SMD file is plain text. It starts with version 1, followed by
sections that each end with end. nodes lists the bones,
each with a number, a name in quotes and the number of its parent, or -1 for the root.
skeleton gives, for each time (frame), the position and
rotation of each bone. triangles lists the mesh: a line naming the
material, then three vertex lines, each giving the parent bone, the position, the
normal, the texture coordinates and, optionally, weights for further bones.
version 1
nodes
0 "root" -1
end
skeleton
time 0
0 0 0 0 0 0 0
end
triangles
metal.bmp
0 0 0 0 0 0 1 0 0
0 1 0 0 0 0 1 1 0
0 0 1 0 0 0 1 0 1
end
Links
Software
- Blender Source Tools – add-on that imports and exports SMD in Blender (Windows, macOS, Linux)
- studiomdl – Valve’s model compiler, in the Half-Life SDK and the Source SDK (Windows)
Developers
- Half-Life SDK – Valve’s code, including the source of
studiomdl(C++)
Reference
- SMD – the Valve Developer Community’s description of the format