SFM Compile Model Compilation & Rendering Guide

asfmcompile.com · Source Filmmaker guides

SFM Compile: The Complete Guide to Compiling Models and Renders in Source Filmmaker

Models, textures, animations, maps and final renders: how the SFM compiler works and how to get every asset into Source Filmmaker without errors. Written for animators, tested in SFM.

Updated September 2026Free tools only100% safe for work
crate_01.qc
$modelname    "props/sfmcompile/crate_01.mdl"
$body         body "crate_01.smd"
$cdmaterials  "models/props/sfmcompile/"
$surfaceprop  "wood"
$sequence     idle "crate_01.smd"
> studiomdl.exe -game “…\game\usermod” crate_01.qc
Writing crate_01.mdl, .vvd, .dx90.vtx
Completed “crate_01.qc”

SFM compile is the step that turns your own 3D work into something Source Filmmaker can actually use. A character can look finished in Blender and still load in SFM as a red ERROR model, a purple checkerboard or a figure lying on its side.

Almost every one of those problems has the same root: one of the files the Source engine expects is missing, misnamed or in the wrong folder.

This guide from SFM Compile (asfmcompile.com) explains what those files are, how the SFM compiler builds them, and how to fix the errors that stop a compile. It covers models, textures, animations and maps, plus exporting your finished animation as video, so you can port your own assets, repair broken downloads and share clean models with other animators.

What Is SFM Compile?

SFM compile is the process of converting your own models, textures, animations and maps into the formats Source Filmmaker can load, and exporting a finished SFM session as a shareable video.

Source Filmmaker is Valve’s free animation tool built on the Source engine. The engine never reads raw Blender, Maya or FBX files. Every model in the Model Browser is a compiled .mdl file, every texture is a .vtf file and every map is a .bsp file.

Many beginners start with the question, “Which button exports my model to SFM?” A compile-first approach asks a more useful one: “Which files does the Source engine need, and where does each of them come from?”

For example, a character that looks finished in Blender does not simply need exporting. It needs a reference mesh, a physics mesh, VTF textures, VMT materials, a QC script and a compile through studiomdl before SFM can use it. That distinction is what separates a quick export from a working SFM asset.

Why SFM Models Fail Without a Proper Compile

Exporting from Blender is not inherently the problem. The challenge is that a mesh on its own hides many details the Source engine depends on.

Some common limitations include:

  • Treating the mesh as the whole model: Geometry is only one file. Materials, bones and physics decide how the model behaves once it is compiled.
  • Missing material paths: If the QC and the VMT files do not point to the same folder, SFM shows a purple and black checkerboard.
  • Untested scale and rotation: Transforms that were never applied in Blender arrive in SFM tiny, huge or sideways.
  • Loose compiled files: An MDL separated from its VVD and VTX files loads as a red ERROR model.
  • Mismatched animation names: A $sequence that points to the wrong file compiles cleanly but never plays.
  • No preview step: Skipping HLMV means every mistake is discovered inside a busy SFM session instead of in seconds.

A structured compile workflow closes this gap by giving you a complete view of what the engine needs before you ever open SFM.

The Core Components of an SFM Compile

A reliable SFM compile brings together several connected parts:

  1. Reference mesh: The visible model, exported as SMD or DMX from Blender, Maya or 3ds Max.
  2. Physics mesh: A simplified collision model used for physics and ragdolls.
  3. Textures: VTF image files created from PNG or TGA with VTFEdit.
  4. Materials: Small VMT text files that tell the engine which shader and textures to use.
  5. QC script: The instruction file that names the model and links every mesh, material and sequence together.
  6. Animations: Separate SMD or DMX files, one per action, listed as sequences in the QC.
  7. The compiler: studiomdl.exe, run directly or through Crowbar, which builds the final MDL, VVD and VTX files.
  8. Testing: A check in HLMV and then in SFM’s Model Browser before the asset is used or shared.

Together, these components turn compiling into a repeatable process rather than a trial-and-error export.

ToolWhat it doesNeeded?
studiomdlCompiles QC plus SMD or DMX into MDLYes, included
CrowbarInterface for compiling and decompiling modelsRecommended
Blender Source ToolsExports SMD and DMX from BlenderYes, for Blender
VTFEditConverts images into VTF texturesYes, for textures
Hammer EditorBuilds maps and runs the BSP compilersOnly for maps
HLMVPreviews compiled models before SFMRecommended

The actual SFM compiler is studiomdl, which ships with Source Filmmaker in its bin folder. Crowbar is a free community tool that wraps it in a simple window, keeps your game setup and can decompile existing models so you can study how they were built. Valve documents every QC command on the Valve Developer Community wiki.

A Practical SFM Compile Workflow

An SFM compile workflow does not need to be complicated. It can start with six practical steps that work for a simple prop or a fully rigged character.

Step 1: Prepare the Model

Finish modeling, UV unwrapping and rigging in your 3D software. Apply scale and rotation, remove unused bones and materials, and keep every file and folder name lowercase with no spaces.

The goal is to hand the compiler clean geometry, so problems in later steps are easy to trace.

Step 2: Export SMD or DMX Files

Use Blender Source Tools to export the reference mesh, an optional physics mesh and any animations. SMD is simple and widely supported. DMX is SFM’s native format and supports facial flexes, so choose it when a character needs expressions or lip sync.

Step 3: Build Textures and Materials

Save each texture as PNG or TGA with power-of-two dimensions, such as 1024 x 1024 or 2048 x 2048. Convert it to VTF in VTFEdit and save it inside materials/models/your_folder/. Then create a VMT file with the same name:

crate_diffuse.vmt
"VertexLitGeneric"
{
    "$basetexture"  "models/props/my_folder/crate_diffuse"
    "$bumpmap"      "models/props/my_folder/crate_normal"
}

VertexLitGeneric is the standard shader for models. Leave the .vtf extension out of the path.

Step 4: Write the QC File

The QC file links everything together. A minimal QC for a static prop with collision looks like this:

my_prop.qc
$modelname      "props/my_folder/my_prop.mdl"
$body           body "my_prop_ref.smd"
$cdmaterials    "models/props/my_folder/"
$surfaceprop    "metal"
$sequence       idle "my_prop_ref.smd"
$collisionmodel "my_prop_phys.smd" { $concave }

These are the QC commands you will use most often:

CommandWhat it controlsExample
$modelnameOutput path and file name inside the models folder“props/crate.mdl”
$body / $modelThe visible mesh; $model is used when the mesh has flexesbody “crate.smd”
$cdmaterialsFolder under materials/ where the VMT files live“models/props/”
$surfacepropPhysical material used for sounds and impacts“metal”
$sequenceAn animation or idle pose, with optional fps and loopwalk “walk.smd” fps 30 loop
$collisionmodelPhysics mesh used for collisions“crate_phys.smd”
$bodygroupParts that can be toggled on or off, such as hatshat { studio “hat.smd” blank }
$texturegroupAlternate skins that swap one material for anotherskinfamilies { … }
$lodLower-detail meshes used at a distance$lod 20 { … }

Step 5: Run the Compiler

Point Crowbar, or studiomdl directly, at the QC file and at SFM’s game folder, usually SourceFilmmaker\game\usermod. Read the last lines of the compile log every time. A clean log ends with a “Completed” line for your QC.

Step 6: Test and Adjust

Compiling should not end when the log says “Completed”. Open the MDL in HLMV to check textures, bones and animations, then load it through SFM’s Model Browser.

Regular testing lets you catch path, scale and animation problems early, and adjust the QC before the asset reaches a real project.

How to Compile Animations and Maps for SFM

Compiling Animations

Animations are exported as separate SMD or DMX files, one per action, using the same skeleton as the reference mesh. Each one becomes a $sequence line in the QC:

character.qc (excerpt)
$sequence idle  "anims/idle.smd"  fps 30 loop
$sequence wave  "anims/wave.smd"  fps 30
$sequence walk  "anims/walk.smd"  fps 30 loop

Most animators keyframe inside SFM itself, so baked sequences are most useful for loops, idle poses and reusable actions.

Compiling Maps

Maps are built in the Hammer Editor that comes with Source Filmmaker and saved as .vmf files. Compiling turns a VMF into a .bsp in three passes:

  • VBSP: Builds the geometry and the world structure.
  • VVIS: Works out what is visible from each area, which keeps the map fast.
  • VRAD: Calculates the lighting, and is usually the slowest pass.

Hammer runs all three when you press F9. Save the result in game\usermod\maps so it appears in SFM’s map list, and seal any leaks before a full compile.

How to Compile a Render in SFM

When an animation is finished, open File, Export, Movie. SFM can write a video file directly or save every frame as an image sequence. For anything longer than a few seconds, an image sequence is the safer choice: if SFM crashes halfway, you keep every frame already rendered.

  • Resolution and frame rate: Match the export to your session settings so motion stays smooth.
  • Sound: Export the audio as a separate WAV file, then join it with the frames in a video editor or with ffmpeg.
  • GIFs and short clips: Export a short image sequence and convert it, rather than exporting video and cutting it down.
  • Render quality: Depth of field and motion blur samples add realism but multiply render time.

How to Measure a Successful SFM Compile

Rather than judging a compile by whether a file was created, measure it by how the asset behaves in SFM.

Useful checks include:

  • A compile log that ends in “Completed” with no errors
  • Textures that load with no purple and black checkerboard
  • Correct scale and orientation next to a stock SFM model
  • Every sequence playing in HLMV and in SFM
  • Working bodygroups and skins
  • Stable performance in a scene with lights and other models
  • A clean render export with no dropped or corrupted frames

Common SFM Compile Errors and How to Fix Them

Most failed compiles come down to a wrong path. Read the last lines of the compile log first, then match the symptom below.

SymptomUsual causeFix
Purple and black checkerboard$cdmaterials does not match the VMT folderCorrect the path and check $basetexture in the VMT
“Error opening file”The QC names an SMD or DMX that is not thereCheck file names and paths relative to the QC
Red ERROR model in SFMVVD or VTX files missing beside the MDLKeep every compiled file together in one folder
Animations will not play$sequence name or file does not matchMatch the names to the exported files and recompile
Model tiny, huge or sidewaysTransforms not applied before exportApply scale and rotation in Blender, or use $scale
Map compile stops at VVISThe map has a leak to the voidLoad the pointfile in Hammer and seal the gap

SFM Export Corrupted

A corrupted or unplayable export usually comes from writing straight to a video format and hitting a codec or memory problem mid-render. Export an image sequence instead, then encode it into MP4 afterwards.

SFM Keeps Crashing

Crashes are most often caused by a broken custom model, too many high-poly models and lights, or very high render samples. Save often, remove the last model you added, and lower sample counts to find the cause.

Optimization Tips

  • Keep polygon counts sensible for the shot, with lighter meshes for background props.
  • Use 2048 textures only where the camera gets close, and 1024 or 512 everywhere else.
  • Add $lod meshes to heavy models used in wide shots.
  • Compile small changes often, so you always know what broke.

Is SFM Compile Safe?

Compiling itself is safe. The tools are free, widely used and run on your own computer. The risks are unofficial downloads and look-alike websites.

There is no single “SFM compile” program to download. Get Source Filmmaker free on Steam (studiomdl and Hammer come with it), Blender from blender.org, and Crowbar, VTFEdit and Blender Source Tools from their developers’ official pages. Avoid any “SFM compile download” offered as a bundled installer or EXE.

Some adult video sites use “SFM compile” in their names, such as sfmcompile.com and SFM Compile Club. SFM Compile (asfmcompile.com) is not one of them, has no connection to them and does not link to them. Everything on this site is safe for work, and it is not affiliated with Valve Corporation.

The Future of SFM Compile

Source Filmmaker is moving from the original Source engine toward Source 2. Source 2 Filmmaker uses the Source 2 asset system and its own tools, so the QC and studiomdl workflow in this guide applies to the original Source Filmmaker.

The skills carry over. Clean geometry, organized materials, sensible naming and testing before use make any engine’s asset pipeline faster and more predictable.

Whatever engine you end up in, the habit that matters most is the same: know which files the engine needs, where each one comes from, and test them before you rely on them.

Frequently Asked Questions

What is SFM compile?

SFM compile is converting models, textures, animations and maps into the MDL, VTF and BSP formats Source Filmmaker loads, and exporting finished animations as video.

Is asfmcompile.com the same as sfmcompile.com or SFM Compile Club?

No. SFM Compile (asfmcompile.com) is an independent, safe-for-work tutorial site. It has no connection to any video site using a similar name.

Is Source Filmmaker free?

Yes. Valve distributes Source Filmmaker free on Steam, and it runs on Windows only.

Do I need Crowbar to compile SFM models?

No. studiomdl can run from the command line on its own. Crowbar sets up paths for you and makes the compile log easier to read.

What files does an SFM compile produce?

An MDL file plus its VVD and VTX files, and a PHY file when the QC includes a collision model. Keep them together in one folder.

Does this work for Source 2 Filmmaker?

No. Source 2 Filmmaker uses the Source 2 asset system and its own tools. The QC and studiomdl workflow is for the original Source Filmmaker.

Conclusion

SFM compile is not one mysterious tool. It is a short chain of files and checks: a clean mesh, VTF textures with matching VMT materials, a QC script, a run through studiomdl or Crowbar, and a test in HLMV before SFM.

Get the paths right and most errors disappear. Keep the compile log open, change one thing at a time, and export long renders as image sequences. With that routine, compiling models, textures, animations and maps for Source Filmmaker becomes predictable, and your time goes into animating instead of troubleshooting.

SFM

Written and tested by the SFM Compile team

We use Source Filmmaker and Blender every week. Every guide is compiled and loaded in SFM before it goes live.

Suggest a guide