/viestories/media/media_files/2026/06/06/sfm-compile-2026-06-06-15-25-51.png)
What Does SFM Compile Mean?
The Source engine from Valve, which powers Team Fortress 2, Half-Life 2, and Portal, serves as the foundation for Source Filmmaker. Performance, not editability, was the focus of the Source engine's design. OBJ, FBX, and GLTF 3D model files cannot be loaded. Rather, it reads efficient binary formats that have been packed and pre-processed.
The process that generates the binary files is called SFM compile. A compiler produces the engine-ready formats that SFM can load from human-readable source assets, such as geometry exported from Blender, textures saved as PNGs, and a text configuration script.
The word compile has the same meaning as in software development: you are converting source material that humans can write and edit into a processed format that a runtime (in this case, the Source engine) can run efficiently.
SFM Compile at a Glance
| SFM Compile at a Glance | Details |
| What It Is | Converting 3D assets into Source engine binary formats |
| Input Files | SMD/DMX (mesh), QC (config), TGA/PNG (textures) |
| Output Files | MDL, VTX, VVD, PHY, VTF, VMT |
| Primary Tool | Crowbar (GUI for studiomdl.exe) |
| Cost | Free — all tools are open/free |
| Difficulty | Moderate — file paths are the biggest challenge |
| Time (first model) | 1-3 hours including setup |
| Required Knowledge | Basic Blender, text editing, file management |
Tools You Need Before You Start
A limited number of tools are needed for the SFM compile pipeline. They're all free. Before you try your first build, all of them must be installed and set up.
| Tool | What it does | Where to get it |
| Crowbar | GUI frontend for studiomdl — the primary compile tool | github.com/ZeqMacaw/Crowbar |
| Blender + Source Tools | 3D modeling and SMD/DMX export | blender.org + BlenderSourceTools |
| VTFEdit | Converts PNG/TGA textures to Valve Texture Format | Nem's Tools / Valve Dev Wiki |
| Notepad++ | Editing QC and VMT files with syntax awareness | notepad-plus-plus.org |
| Source SDK | Contains studiomdl.exe, the actual compiler Crowbar calls | Steam → Library → Tools |
The majority of creators directly connect with Crowbar. It offers a graphical user interface for Valve's command-line model compiler, studiomdl.exe, which is part of the Source SDK. Consider Studiomdl as the engine under the hood and Crowbar as the dashboard.
The File Types in an SFM Compile Pipeline
You must comprehend the functions of each file format before using any tool. A compile fails if any one of the several formats used in the pipeline is absent, incorrectly labeled, or malformed.
Source Files (What You Start With)
.SMD
Studiomdl Data
This is the main format most people start with. It contains all the essential data, such as the model’s shape (mesh), bone structure, and animations.
Typically, you’ll have one SMD file for the main model and separate SMD files for each animation.
.DMX
Data Model Exchange
DMX is a newer and more advanced format developed by Valve. It offers greater precision and supports more complex features, such as facial expressions and detailed rigs.
If you’re working on characters with facial animations or more advanced setups, DMX is usually the better choice.
.QC
QuakeC Script
The most important file. This plain text script tells the compiler how to assemble everything: mesh, textures, animations, and physics.
.TGA / .PNG
Texture Sources
Your raw texture images before conversion. These must be converted to VTF before the engine can use them.
.VMT
Valve Material Type
A plain text file that describes how to render a texture, including normal maps, shaders, and transparency.
Understanding the QC File
The QC file is basically the blueprint of your entire compile process. It’s a simple text file containing commands that the studiomdl compiler reads line by line. Once you understand how to read and write QC files, you move beyond just following tutorials—you actually start understanding how SFM compilation really works.
Anatomy of a Basic QC File (Static Prop)
$modelname "props/my_prop/my_prop.mdl"
$cdmaterials "models/props/my_prop/"
$body mybody "my_prop_reference.smd"
$surfaceprop "metal"
$staticprop
$sequence "idle" "my_prop_idle.smd" fps 30
$collisionmodel "my_prop_phys.smd" {
$mass 50
$concave
}
QC Command Reference
| $modelname | Defines the output path of the compiled MDL, relative to the models folder |
| $cdmaterials | Points the model to the folder containing its VMT material files |
| $body | Declares the reference mesh SMD — the geometry of the model |
| $surfaceprop | Sets the physical surface material (affects sound and particles on impact) |
| $staticprop | Marks as a non-animated static prop, enabling compiler optimizations |
| $sequence | Declares an animation sequence and points to its SMD file |
| $collisionmodel | Defines the physics collision mesh and sets properties like mass |
QC File for an Animated Character
$modelname "characters/hero/hero.mdl"
$cdmaterials "models/characters/hero/"
$body mybody "hero_reference.smd"
$surfaceprop "flesh"
$sequence "idle" "hero_idle.smd" fps 30 loop
$sequence "walk" "hero_walk.smd" fps 30 loop
$sequence "run" "hero_run.smd" fps 40 loop
$sequence "attack" "hero_attack.smd" fps 24
$attachment "eyes" "ValveBiped.Bip01_Head1" 3 4 0 rotate 0 -80 -90
Preparing Textures with VTFEdit
SFM cannot use PNG or JPEG textures directly. Every texture must be converted to VTF format, and each VTF needs an accompanying VMT file that tells the engine how to render it.
Converting a Texture to VTF
- Open VTFEdit and go toFile → Import
- Select your texture file (PNG or TGA — TGA preferred for quality)
- Choose compression:DXT1for opaque textures,DXT5for transparency
- Set the output directory to match the$cdmaterialspath in your QC file
- Save as a VTF file
Writing the VMT File
The VMT is a plain text file saved in the same directory as your VTF:
VMT File
"VertexLitGeneric"
{
"$basetexture" "models/props/my_prop/my_prop_diffuse"
"$model" "1"
}
Compiling with Crowbar: Step-by-Step
With your SMD files, QC file, VTF textures, and VMT material files ready, you are ready to run the actual compile.
Initial Crowbar Setup (Do This Once)
- Download and install Crowbar from theGitHub releases page
- Open Crowbar and navigate to theSet Up Gamestab
- AddSource Filmmakeras a game target
- Point Crowbar to your SFM'sgameinfo.txt— typically at:steamapps/common/SourceFilmmaker/game/usermod/gameinfo.txt
- Confirmstudiomdl.exeis detected automatically from the Source SDK
Running a Compile
- Click theCompiletab in Crowbar
- UnderQC File, browse to and select your.qcfile
- UnderOutput To, select the Game's "models" folder.
- ClickCompile
- Watch the output log carefully — this is where errors appear.
- If the log ends with"Compilation succeeded,"your MDL is in place.
- Open SFM → Animation Set Editor →Create Animation Set for New Model→ load your MDL.
| Log Output | Meaning | Action |
| ERROR: cannot open ...smd | File path in QC doesn't match actual | location Fix the path in your QC |
| WARNING: no LOD entries | No level-of-detail meshes defined | Ignore for personal projects |
| ERROR: material not found | VMT file missing or wrong directory | Check $cdmaterials path |
| Bone ... not in reference | Animation uses bones not in reference mesh | Re-export from same rig |
| Compilation succeeded | MDL and supporting files created | Load model in SFM ✅ |
Decompiling Existing Models
One of the best ways to learn is to decompile models that already work in SFM and study their structure.
- In Crowbar, click theDecompiletab
- UnderMDL File, select the compiled .mdl you want to examine
- Set the output folder to a working directoryoutsideyour SFM installation
- ClickDecompile— Crowbar extracts SMD files, the QC script, and texture references
The VTF is not found by the engine. Verify three items:
- The appropriate materials subdirectory contains the VMT file.
- The VMT's $basetexture path is accurate.
- The actual filename that the VMT refers to is present in the VTF file.
Workflow Tips for Faster, Cleaner Compiles
Use a Consistent Folder Structure
project/
modelsrc/ ← Source files (SMD, QC, TGA)
characters/hero/
hero_reference.smd
hero_idle.smd
hero_walk.smd
hero.qc
usermod/
models/characters/hero/ ← Compiled MDL output
materials/models/characters/hero/ ← VTF and VMT files
Begin with a Basic Static Prop
A fully animated figure shouldn't be your first compilation. Start with a single geometry, a single texture, and no animations. Before doing anything complicated, make sure that it is operating flawlessly.
Increment Model Names During Testing
(Time Saver)
When you’re testing different versions of your model, it’s a good idea to slightly change the name each time—like hero_v2.mdl, hero_v3.mdl, and so on.
Keep Source Files Backed Up
(Essential)
Your SMD files and QC script are your real assets—they’re the source of everything. The compiled MDL file can always be recreated from them.
That’s why it’s important to keep your modelsrc folder safely backed up, whether in version control or a separate storage location.
Compiling Animated Models and Characters
Rigging Requirements
Based on the ValveBiped bone naming convention, Source Filmmaker employs Valve's biped skeleton system for humanoid characters. In order for the character to use pre-existing SFM animation rigs, you must retarget or rename bones to conform to this norm when porting from another engine.
Exporting Animation SMDs
In Blender with the Source Tools addon:
- Select thearmaturein your scene.
- Set theexport actionto the specific animation you want
- Export asSMD
- Repeat for each animation — each export produces one SMD file.
Conclusion
It integrates custom models and animations into the Source Filmmaker; SFM compilation is an important step. Learning the fundamentals of tools, file formats, and QC scripts makes the process much simpler over time, even though it may seem confusing at first. Creators can enhance their overall SFM projects and produce high-quality bespoke content with experience.