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

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 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. This guide from SFM Compile (asfmcompile.com) walks through every type of compile, from your first QC file to a clean final render.

What is SFM compile?

Source Filmmaker (SFM) is Valve’s free animation tool built on the Source engine. The engine never reads raw Blender, Maya or FBX files. Every model in SFM’s Model Browser is a compiled .mdl file, every texture is a .vtf file and every map is a .bsp file. Turning source files into those formats is what people mean by “SFM compile”.

The phrase covers two jobs:

  • Asset compiling: turning meshes, textures, animations and maps into MDL, VTF and BSP files with studiomdl, VTFEdit and the Hammer map compilers.
  • Render compiling: exporting a finished animation as a movie or image sequence, then joining the frames and sound into one file.

Compiling is worth learning even if you only use Workshop assets. Once you can compile, you can fix broken downloads, change skins and bodygroups, port your own characters and props, and share clean, lightweight assets with other animators.

The SFM compiler and the tools you need

The actual SFM compiler is studiomdl.exe, which ships with Source Filmmaker in its bin folder. It is a command-line program: it reads a QC file, follows every path inside it and writes the compiled model into the game’s models folder. Valve documents every QC command on the Valve Developer Community wiki.

Crowbar is a free community tool that wraps studiomdl in a simple window. It remembers your game setup, shows the compile log in a readable form and can decompile existing MDL files back into SMD and QC, which is the fastest way to learn how a working model was built.

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
Text editorWrites QC and VMT files (Notepad++ or VS Code)Yes

How SFM compile works, step by step

Every model compile follows the same five steps, whether it is a simple crate or a fully rigged character.

01

Build and prepare the model

Model, UV unwrap and rig in Blender, Maya or 3ds Max. Apply scale and rotation before exporting so the model does not arrive tiny or sideways.

02

Export SMD or DMX files

Export the reference mesh, an optional physics mesh and any animations. SMD is simple and widely supported; DMX adds facial flexes for expressions and lip sync.

03

Write the QC file

A plain text script that tells the compiler the model’s name, its meshes, where its materials live and which animations to include.

04

Run the compiler

Point Crowbar, or studiomdl directly, at the QC file and at SFM’s game folder, usually SourceFilmmaker\game\usermod, then read the log.

05

Test the result

Open the MDL in HLMV to check textures, bones and animations, then load it through SFM’s Model Browser.

A minimal QC file 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 }

QC file commands explained

The QC file is where most compile problems start and end. These are the commands you will use in almost every SFM model:

CommandWhat it controlsExample
$modelnameOutput path and file name, relative to 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 hats or bagshat { studio “hat.smd” blank }
$texturegroupAlternate skins that swap one material for anotherskinfamilies { … }
$lodLower-detail meshes used at a distance$lod 20 { … }

Compiling textures for SFM: VTF and VMT

A texture in Source Filmmaker is always two files. The .vtf file holds the image, and the .vmt file is a small text material that tells the engine which shader to use and where the image is.

  1. Save your texture as PNG or TGA with power-of-two dimensions, such as 1024 x 1024 or 2048 x 2048.
  2. Open it in VTFEdit, choose Import, and save it as VTF inside materials/models/your_folder/.
  3. Create a VMT file with the same name in the same folder, using the template below.
  4. Make sure the $cdmaterials line in your QC points at that same folder.
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, and keep folder names lowercase.

Compiling animations for SFM

Animations are exported from your 3D software 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

Recompile, then check each sequence in HLMV before opening SFM. Most animators keyframe inside SFM itself, so baked sequences are most useful for loops, idle poses and reusable actions.

Compiling maps for SFM

Maps are built in the Hammer Editor that comes with Source Filmmaker and saved as .vmf files. Compiling turns a VMF into a playable .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. A map with leaks will fail VVIS, so seal the level before a full compile.

Compiling a render: video, image sequences and sound

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.

Optimization tips for a faster, cleaner compile

  • Keep polygon counts sensible for the shot. Hero characters can be detailed; background props should be light.
  • 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.
  • Remove unused bones and materials before exporting.
  • Keep file and folder names lowercase with no spaces, and give each model its own folder.
  • Compile small changes often instead of one large change, so you always know what broke.

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 during work or export 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.

SFM compile download: getting the tools safely

There is no single “SFM compile” program to download. You need a few free tools, and each has one official source:

  • Source Filmmaker: free on Steam, Windows only. studiomdl and Hammer come with it.
  • Blender: blender.org.
  • Blender Source Tools, Crowbar and VTFEdit: their developers’ official pages.

Avoid sites offering an “SFM compile download” as a bundled installer or EXE. Those files are not needed for compiling and are a common way malware spreads.

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, covered above, and look-alike websites.

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.

SFM compile FAQ

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.

From the blog

Latest SFM guides

View all articles →

New guides are on the way.

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