What Is SFM Compile? A Guide for Creators
In modern animation tools, many processes run in real time. But in Source Filmmaker (SFM)—a tool made by Valve—compiling is still a key part of making animations.
If you use SFM to make scenes, convert models, or export maps for machinima, SFM Compile means changing your files into a format that SFM can read and play back. This process helps your content work better inside the tool.
This guide explains what SFM Compile is, what it does, and how to use it. Whether you’re new to SFM or have experience with modding, knowing how to compile files is important.
If you need to find the compile tools, use command-line options, or fix errors, go to the navigation section below for direct help.
What Is SFM Compile?
In Source Filmmaker (SFM), “compile” means changing raw files—like models, maps, materials, or scripts—into formats that SFM can load and use.
This process takes files made by users (such as .SMD
, .DMX
, or .QC
) and turns them into game-ready formats (like .MDL
for models or .BSP
for maps). These new files work inside the Source engine.
You need to compile when you:
-
Add custom models or characters
-
Bake lighting or shadows into a map
-
Create props or particles for in-engine use
-
Link textures and materials so they load correctly
Unlike some engines that compile in the background, SFM needs the user to do this step manually. Because of this, compiling in SFM is often seen as a key task for creators.
Starter Kit: Writing a QC File for SFM Compile
🔹 What Is a QC File?
A .QC
file is a plain-text script used in Source Filmmaker (SFM). It tells the Source Model Compiler (studiomdl.exe
) how to turn .SMD
or .DMX
files into a model file (.MDL
) that SFM can load.
The .QC
file gives the compiler instructions about:
-
The name of the model
-
The model’s body parts
-
What textures or materials to use
-
Where hitboxes are placed
-
What animations to include
This file is required when you compile custom models into SFM compile. Without a QC file, the compiler will not know how to build your model.
Basic QC File Template
qcCopyEdit$modelname "your_folder/your_model.mdl" // Output location and name
$body "Body" "your_model_reference.smd" // Reference SMD or DMX file
$surfaceprop "metal" // Material surface type (affects sound, physics)
$cdmaterials "models/your_folder" // Path to your textures (relative to 'materials' folder)
$sequence idle "your_idle_animation.smd" fps 30 // Idle animation sequence
$collisionmodel "your_model_reference.smd" { // Physics mesh (can use same as body)
$mass 10
$concave
}
Explanation of Key Lines in a QC File
QC Directive | What It Does |
---|---|
$modelname |
Sets the folder path and file name for the compiled model. |
$body |
Defines which mesh file to use as the main model. |
$surfaceprop |
Sets the material type for physics and sound properties. |
$cdmaterials |
Points to the folder where textures are stored. |
$sequence |
Adds animation to the model and sets the frame rate. |
$collisionmodel |
(Optional) Adds physics data for ragdoll or object collisions. |
Each line in the QC file helps the compiler know how to build and prepare the model for use in SFM.
Expected Folder Structure
bashCopyEditSourceFilmmaker\
├── game\
│ └── usermod\
│ ├── models\
│ │ └── your_folder\
│ │ └── your_model.mdl ← Output here
│ └── materials\
│ └── models\
│ └── your_folder\
│ └── your_textures.vtf/.vmt
How to Compile a Model for SFM
-
Save Your QC File
Save your script asyour_model.qc
. -
Organize Files
Put the.QC
,.SMD
, and texture files in the same folder. -
Open Command Prompt
PressWin + R
, typecmd
, and hit Enter. -
Go to the SFM Bin Folder
Type the following (adjust the path if needed): -
Run the Compile Command
Type:Replace
path\to\your_model.qc
with the full path to your QC file.
✅ Quick Tips
-
File names are case-sensitive. Check spelling carefully.
-
Keep folder paths clean—avoid spaces and special characters.
-
Run
studiomdl.exe
from the command line to see compile logs. -
Start with a simple prop model to test your setup. Add more later.