SFM Compile: The Complete Guide to Source Filmmaker Model Compilation
Everything you need to know — from raw 3D files to a working model inside SFM. This guide covers the full pipeline: tools, file types, QC scripting, texture preparation, Crowbar compilation, troubleshooting, and advanced techniques.
All tools free to use
Quick answer: SFM compile is the process of converting raw 3D assets (SMD, DMX, QC files) into the binary formats the Source engine reads (MDL, VTX, VVD, PHY). The primary tool used is Crowbar, a free GUI application that drives Valve's studiomdl compiler.
📋 Table of Contents
- What Does SFM Compile Mean?
- Tools You Need Before You Start
- The File Types in the Pipeline
- Understanding the QC File
- Preparing Textures with VTFEdit
- Compiling with Crowbar: Step-by-Step
- Decompiling Existing Models
- Common Errors and How to Fix Them
- Workflow Tips for Faster Compiles
- Compiling Animated Models & Characters
- Advanced Topics
- Frequently Asked Questions
What Does SFM Compile Mean?
Source Filmmaker is built on Valve's Source engine, the same engine that powers Team Fortress 2, Half-Life 2, and Portal. The Source engine was designed for performance, not editability. It does not load 3D model files in formats like OBJ, FBX, or GLTF. Instead, it reads its own optimized binary formats that have been pre-processed and packed.
SFM compile is the step that creates those binary files. You start with human-readable source assets — geometry exported from Blender, textures saved as PNGs, and a text configuration script — and you run them through a compiler that outputs the engine-ready formats SFM can actually load.
The word compile here means the same thing it does 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 efficiently execute.
📌 SFM Compile at a Glance
| 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
The SFM compile pipeline requires a small set of tools. All of them are free. You need all of them installed and configured before you attempt your first compile.
| 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 |
Crowbar is the application most creators interact with directly. It provides a graphical interface over studiomdl.exe, which is Valve's command-line model compiler included in the Source SDK. Think of Crowbar as the dashboard and studiomdl as the engine under the hood.
The File Types in an SFM Compile Pipeline
Before touching any tool, you need to understand what each file type does. The pipeline involves distinct formats, and a compile fails if any one of them is missing, misnamed, or malformed.
Source Files (What You Start With)
Studiomdl Data
The workhorse format. Contains mesh geometry, bone structure, and animation data. One reference SMD for the mesh, separate SMDs for each animation.
Data Model Exchange
Newer Valve format. More precise than SMD, supports facial flexes and complex rigs better. Prefer DMX for animated characters with facial controls.
QuakeC Script
The most important file. This plain text script tells the compiler how to assemble everything: mesh, textures, animations, physics.
Texture Sources
Your raw texture images before conversion. These must be converted to VTF before the engine can use them.
Compiled Files (What You End Up With)
Compiled Model
The primary file SFM loads. Contains model header, bone hierarchy, bodygroups, and references to all supporting files.
Vertex Data
GPU-optimized vertex data. Generated automatically alongside the MDL during compilation.
Vertex & Weight Data
Vertex and weight data used by the Source engine's rendering system. Also generated automatically.
Physics Collision
Physics collision model. Only generated if your QC includes a $collisionmodel command.
Valve Texture Format
The compiled texture file. Converted from TGA or PNG using VTFEdit.
Valve Material Type
Plain text file defining how to render a texture: shader, transparency, normal maps, and more.
Understanding the QC File
The QC file is the blueprint of your compile. It is a plain text document containing a series of commands that the studiomdl compiler reads line by line. Learning to write and read QC files is what separates creators who understand SFM compile from those who just follow steps blindly.
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
| QC Command | What It Does |
|---|---|
$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 to File → Import
- Select your texture file (PNG or TGA — TGA preferred for quality)
- Choose compression: DXT1 for opaque textures, DXT5 for 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:
"VertexLitGeneric" { "$basetexture" "models/props/my_prop/my_prop_diffuse" "$model" "1" }
The $basetexture path does not include the file extension and is relative to the game's materials folder.
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 the GitHub releases page
- Open Crowbar and navigate to the Set Up Games tab
- Add Source Filmmaker as a game target
- Point Crowbar to your SFM's
gameinfo.txt— typically at:steamapps/common/SourceFilmmaker/game/usermod/gameinfo.txt - Confirm
studiomdl.exeis detected automatically from the Source SDK
Running a Compile
- Click the Compile tab in Crowbar
- Under QC File, browse to and select your
.qcfile - Under Output To, select the Game's "models" folder
- Click Compile
- 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
Reading the Crowbar Output Log
| 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 the Decompile tab
- Under MDL File, select the compiled .mdl you want to examine
- Set the output folder to a working directory outside your SFM installation
- Click Decompile — Crowbar extracts SMD files, the QC script, and texture references
Study the resulting QC file structure. Look at how $body references the mesh SMD, how $sequence entries are named, and how $cdmaterials is formatted. QC files from professionally made models are excellent templates.
Common SFM Compile Errors and How to Fix Them
The majority of compile failures come from a handful of recurring causes.
👻 Model Does Not Appear After Successful Compile
Very CommonA compile can succeed and the model still not appear. This almost always means the MDL was placed in the wrong directory.
Fix: Verify that the $modelname path in your QC matches exactly the location in SFM's usermod/models folder, including subfolder structure.
🟪 Pink and Black Checkerboard on the Model
Very CommonThe engine cannot find the VTF. Check three things:
- The VMT file exists in the correct materials subfolder
- The
$basetexturepath inside the VMT is correct - The VTF file has the exact filename the VMT references
🦴 Bone in Animation Not Found in Reference
CommonYour animation SMD was exported from a different version of your rig than your reference SMD.
Fix: Re-export the animation SMD from the same Blender file and armature that produced your reference SMD.
🎨 Too Many Materials Used
IntermediateThe Source engine imposes a limit on materials per model.
Fix: Consolidate texture maps — combine similar materials, use UV atlases, or split a complex model into multiple separate models.
📂 Model Has No Sequence
CommonEven static props need at least one idle sequence.
Fix: Add a basic $sequence "idle" pointing to a valid SMD file.
💥 Compile Crashes Without Error Message
FrustratingEither the file path is too long (Windows 260-character limit), or the polygon count is pushing memory limits.
Fix: Move your project closer to the drive root (e.g., C:\SFM\ instead of a deep nested folder).
Workflow Tips for Faster, Cleaner Compiles
Use a Consistent Folder Structure
Best Practiceproject/ 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
Start With a Simple Static Prop
RecommendedYour first compile should not be a full animated character. Start with one mesh, one texture, no animations. Get that working perfectly before attempting anything complex.
Increment Model Names During Testing
Time SaverWhen iterating, rename your output — hero_v2.mdl, hero_v3.mdl — so old compiled versions do not interfere. SFM caches model data, and testing under the same name as a cached broken model produces confusing results.
Keep Source Files Backed Up
EssentialYour SMD files and QC script are the source of truth. The compiled MDL can always be regenerated from them. Store your modelsrc folder in version control or a separate backup.
Compiling Animated Models and Characters
Rigging Requirements
Source Filmmaker uses Valve's biped skeleton system for humanoid characters, based on the ValveBiped bone naming convention. If porting from another engine, you must retarget or rename bones to match this convention for the character to use existing SFM animation rigs.
Exporting Animation SMDs
In Blender with the Source Tools addon:
- Select the armature in your scene
- Set the export action to the specific animation you want
- Export as SMD
- Repeat for each animation — each export produces one SMD file
Your QC file then references all of these SMD files in separate $sequence commands.
Flex Controllers and Facial Animation
Facial animation in SFM is driven by flex controllers — morph targets defined in your model. Setting up flexes requires shape keys in Blender exported as DMX rather than SMD, and configured in the QC with $flexcontroller and $flex commands.
Beyond the Basics: Advanced Topics
Porting Models From Other Games
AdvancedPorting involves extracting the mesh and textures using game-specific tools, converting the mesh to SMD via Blender, converting textures to TGA, then following the standard pipeline. Bone structure is the biggest challenge — different skeleton conventions require weight painting to a Valve-compatible rig.
Level of Detail (LOD) Models
PerformanceFor performance-intensive scenes, LOD models improve frame rate. Add them with the $lod command. For typical SFM cinematics, LOD is rarely necessary.
Physics and Ragdolls
IntermediateA ragdoll requires a physics SMD defining collision shapes and a $collisionmodel section in the QC. Each physics object corresponds to a bone, and $mass determines ragdoll behaviour under gravity.
Batch Compiling Multiple Models
AutomationAutomate the compile step using a batch script that calls Crowbar on multiple QC files sequentially — useful for characters with multiple cosmetic variants or full prop sets.
Putting It All Together
SFM compile is a multi-step pipeline, but once you understand each component's role, the process becomes systematic. You have source files, a configuration script, and a compiler that translates them into engine-ready formats. When something goes wrong — and it will — the compile log tells you exactly where to look.
The fastest path to competence is practice on small, simple projects. Compile a static cube. Then a static prop with textures. Then a simple animated character with two sequences. Each successful compile builds your understanding of the file relationships and directory conventions that govern the entire pipeline.
The full pipeline in one line:
- 1 Model in Blender — create or import your 3D mesh and rig
- 2 Export SMD files — reference mesh + separate animation SMDs
- 3 Write QC script — define paths, sequences, materials, and physics
- 4 Convert textures — TGA/PNG → VTF using VTFEdit
- 5 Write VMT files — tell the engine how to render each texture
- 6 Compile in Crowbar — run studiomdl via Crowbar's GUI
- 7 Load in SFM — create animation set for your new MDL
Frequently Asked Questions
$modelname path in the QC does not match where SFM is looking. Double-check that the subfolder structure in your QC's $modelname matches the actual file location inside SFM's usermod/models directory.Methodology & Disclosure
Data sources: First-hand testing of the SFM compile pipeline using Crowbar, Blender with Source Tools, and VTFEdit. Valve Developer Community wiki referenced for QC command accuracy. Community forums (r/SFM, Facepunch) consulted for common error patterns.
Limitations: Valve occasionally updates Source engine tools and formats. Specific studiomdl behaviours may vary between SDK versions. Always check the Valve Developer Community wiki for the latest information.
Disclosure: RAIN AI Services is not affiliated with Valve, the Crowbar project, or any tool mentioned. This guide provides practical technical guidance. No affiliate commissions, referral fees, or sponsorships are involved.
Based on first-hand pipeline testing and publicly available documentation. Source engine tools may change over time. Check the Valve Developer Community wiki for the latest information.