...
spf

SFM Compile: Getting Custom Models Into Source Filmmaker

19 Min Read

SFM compile turns your 3D model into a .mdl file Source Filmmaker loads. The build happens outside the animation tool. Blender exports the mesh, a compiler named studiomdl turns it into engine files, and only then does SFM list the asset.

The usual entry point is a failure. You drop a freshly exported model into the SFM folders, open the program, and the model is not there, or it shows up as a checkerboard, or the console fills with red text. Nothing about that moment tells you the problem started earlier, at export, in a folder name, or in a texture that was never converted.

Almost every failed compile is an upstream failure the compiler merely reports. The chain has five links: model, export, QC file, compiler, placement. Walk them in order once, and an SFM compile stops being a wall and becomes a repeatable checklist.

What an SFM Compile Actually Produces

Source games do not load the files 3D software saves. A .blend project, an .fbx, an .obj: none of them means anything to the engine. What loads is the compiled model set, a .mdl file plus the vertex and rendering data that must ride beside it.

Intermediate formats carry the work between programs. SMD is a text format and DMX a binary one; both are written by exporter plugins, and both describe the same mesh, skeleton, and animations. The QC file is the instruction sheet. The compiler itself is studiomdl, which Valve documents on its Developer Community wiki along with the whole QC language.

So the phrase SFM compile describes a stage, not a program. SFM has no compile button; the toolchain produces the files and SFM consumes them. That distinction clears up half the beginner confusion by itself.

The output of a successful build is a small family of files that always travel together:

  • .mdl: the compiled model definition SFM loads.
  • .vvd: vertex data the engine needs beside every .mdl.
  • .vtx: rendering data, split into optimized strips for different hardware levels.
  • .phy: an optional physics hull, produced only when the QC defines a collision model.

Copying one of these without the others is the fastest way to break a model that compiled cleanly. The same file set is what Garry’s Mod and every other Source game reads, which is why a single build serves several games.

Where Compiling Sits in the Pipeline

Compiling sits near the end of a longer chain, and each link leaves traces the next one inherits. The full route for a custom model runs like this:

  1. Model and UV-map the mesh in Blender, Maya, or 3ds Max.
  2. Paint or generate the textures as ordinary image files.
  3. Rig the skeleton for anything that will move or pose.
  4. Export with a Source-capable add-on such as Blender Source Tools; the output is SMD or DMX.
  5. Write the QC file that describes the build.
  6. Run the compile through Crowbar or directly through studiomdl.
  7. Confirm the compiled files landed in the content folders SFM reads.
  8. Start SFM and load the model.

Step six is the SFM compile in the narrow sense, but steps four, five, and seven cause most of its failures. An export that dropped the armature produces a model that compiles and then will not pose. A QC path that does not match the folder you actually used makes studiomdl report files it cannot find. A file set that lands in the wrong game folder never shows up at all.

Can You Compile Without Crowbar?

Yes. Crowbar is a free graphical front end for studiomdl, the same compiler that runs underneath; you can call studiomdl directly from a command line, and the older GUIStudioMDL wrapper is the alternative veterans used before Crowbar. The compiler does not care which face it wears.

Crowbar earned its place because it adds a file dialog, a readable log window, and saved game configurations. None of that changes the underlying step: it invokes studiomdl with your QC file and shows you the output. The one real prerequisite is that a Source install on your machine provides studiomdl; the free Source SDK 2013 from Steam ships the compiler binaries, and if Crowbar’s configuration list has no entry that can supply them, that SDK is the standard fix.

When Do You Actually Need to Compile?

You need an SFM compile only when a model is not already Source-ready. Workshop models and published model packs load as-is. Anything you build yourself, or edit, must pass through the toolchain before SFM will list it.

Steam Workshop items and the character packs shared across the community arrive already compiled, which is why beginners can animate for months without ever touching a QC file. The compile enters your life at the moment you want an asset that does not exist yet: your own character, a prop from your own project, or a modification of something you downloaded.

Edited content counts as new content. Change a mesh, rerig a skeleton, or repaint a texture, and the download you started from is no longer the asset you are holding; the compiler has to rebuild it before SFM can trust the result. Ported models ripped from commercial games usually arrive compiled too, but they sit in a legal gray zone, because extracting assets from a game can breach its terms and copyright even when the port is shared freely. Original models and properly licensed packs keep a published project clean, and they compile more reliably, since every file in the chain is yours.

The rule compresses to one sentence: compile when you created or changed the asset, skip when you only placed it.

What the QC File Controls

A QC file is a few lines of plain text. Notepad opens it, and every line is a directive that starts with a dollar sign. It tells studiomdl what to name the finished model, where the geometry lives, where the textures sit, which animation sequences to fold in, and whether a collision shape is needed.

The paths in a QC file are literal. The compiler does not guess: it looks for exactly the folder and file names the QC names. Mesh and sequence files resolve relative to the folder that holds the QC, while material paths resolve relative to the materials root named by $cdmaterials. Mixing the two reference points is a recurring first-compile error; so is a single mistyped folder name, which the log reports only as a file it cannot find.

$modelname "myprops/crate01.mdl"
$body mybody "crate01_reference.smd"
$cdmaterials "models/myprops"
$surfaceprop "wood"
$sequence idle "crate01_reference.smd"

Reading it line by line:

  • $modelname sets the output path and name inside the game tree. This compile writes models\myprops\crate01.mdl into the content folder of the configured game.
  • $body attaches the reference SMD that carries the mesh.
  • $cdmaterials names the materials folder root, so this model expects its textures under materials\models\myprops.
  • $surfaceprop declares what the surface behaves like, wood, metal, or flesh, which drives the sounds and physics reactions Source plays against it.
  • $sequence imports an animation from an SMD and names it; the idle sequence above is the minimum most static props carry.

Characters extend the same file with bones, more $sequence lines, and $flexcontroller groups that drive facial expressions. A static crate needs none of that, which is why it is the right first target.

Naming deserves its own rule: folder and file names with spaces or unusual characters produce errors that look nothing like naming problems. Community convention keeps everything lowercase with underscores, and once a name appears in a QC file it stops being changeable casually, because every path and material reference now points at it. Decide names before you write the QC, not after.

Textures Are a Separate Step

A compile can succeed while the model still looks broken, because Source renders textures through its own material system. That system is where the purple-and-black checkerboard comes from.

The texture chain has two files. The VTF holds the image data; the VMT is a short text file that points the engine at the VTF and sets shader options. Blender exports neither. The advice to save textures as VTF skips the question that stops most beginners, which is where the VTF comes from.

Conversion is the missing middle. VTFEdit and its command-line sibling VTFCmd take a PNG or TGA and write a VTF; both are free community tools that have handled this job for as long as Source content has been made by hand. Convert the image, then place both files where the model expects them.

"VertexLitGeneric"
{
	"$basetexture" "models/myprops/crate01"
}

The sample VMT above lives at materials\models\myprops\crate01.vmt, and $basetexture points to the VTF by folder path without an extension. When the checkerboard appears, the model loaded but the engine could not resolve that path: the VMT or VTF is missing, a folder is misspelled, or the files landed somewhere $cdmaterials does not promise. Geometry and materials fail independently, so an SFM compile can finish clean while the model still shows a checkerboard until the material side matches.

Your First SFM Compile, Step by Step

Start with a static prop, not a character. A crate or a rock has no skeleton, no animation, and no flexes, so the compile chain shows itself in its shortest form. The walkthrough below uses a crate named crate01; build any box, follow the folder names exactly, and the same steps work with your own name swapped in.

  1. Model a simple box in Blender and unwrap it. Apply the object’s scale and rotation before exporting, because the compiler reproduces exactly what the exporter hands it; a prop that arrives the wrong size almost always traces back to this step, never to the compiler.
  2. Give the box one material named crate01 and assign a texture image to it. One material keeps the first VMT trivial; multi-material props just repeat the same pattern per material.
  3. Export a static prop through Blender Source Tools as SMD. The add-on writes crate01_reference.smd into your work folder. Keep one work folder per model, and keep the exports inside it.
  4. Write the QC file from the previous section, save it as crate01.qc next to the SMD, and convert the texture to VTF with VTFEdit or VTFCmd. Write the matching VMT from the texture section as well.
  5. Lay out the destination folders first. In Source Filmmaker’s usermod content folder, create models\myprops and materials\models\myprops. In Crowbar, use a game configuration that points at the Source Filmmaker install and its usermod folder, so the compiler writes into the tree SFM actually reads.
  6. Put the VMT and VTF into materials\models\myprops, load crate01.qc into Crowbar, and run the compile. The log window shows every line studiomdl prints; a clean run ends by naming the files it wrote, and a failing run names the file and line it choked on. Fix that one thing and compile again. First compiles rarely pass on the first attempt, and the log is the diagnosis, not a verdict.
  7. Restart Source Filmmaker so it re-reads its content folders, then open the Animation Set Editor, create a new element, and pick the model at myprops\crate01. Place it in a scene. A textured crate that you can move and rotate is the entire chain working end to end.

Check the folder after the compile finishes. A clean build leaves crate01.mdl, crate01.vvd, and crate01.vtx together in models\myprops, with a crate01.phy added only if the QC defined a collision model. If any file of the set is missing or got moved afterward, the model that loaded minutes ago will stop loading.

The verification moment matters more than it looks. A crate that shows up textured proves the export, the QC paths, the material placement, and the game configuration all agree, which is exactly the set of things that breaks on every later model when it breaks at all.

Compiling a Character: What Changes

A character runs the identical compile with three additions: a skeleton, animation files, and flex data for the face. None of them change how studiomdl works. They add lines to the QC and files to the export.

In Blender you rig the character, then export twice through Blender Source Tools. The reference SMD carries the mesh plus its skeleton; every animation you want becomes its own SMD named after the action, such as walk, run, or idle. An SFM compile of a character therefore starts with several SMD files where the crate had one.

The QC grows to match: one $sequence line per animation SMD, a $collisionmodel so the engine treats the body sensibly, and $flexcontroller lines when the face needs to express anything. Flexes are prepared in the modeling software and declared here; when the controller setup is missing, the character loads with a frozen face, and no post-compile editing changes that.

Order the work the way the crate taught you. Compile the reference with a single idle sequence first, confirm the rig poses in SFM, then add the remaining sequences and the flex controllers. When the log reports an unknown bone, it names the bone, and the usual cause is an animation exported against an older version of the skeleton. The rig has to be final before any animation SMD leaves Blender.

Why Won’t SFM Load My Compiled Model?

The compile finished, yet SFM shows nothing, an error stand-in, or a checkerboard. The causes are almost always placement, path, or material problems rather than the compile itself: files in the wrong folder, a QC path that does not match, or VMT and VTF files missing from the materials tree.

The model never appears in the element list.
The files are not where SFM looks. Confirm the compiled set sits in usermod\models\myprops and restart SFM so the content folders are re-read; then check that the path you are searching matches $modelname exactly.
The model shows as an error stand-in.
SFM found a reference it cannot fully load, usually because a sibling file is missing. Keep .mdl, .vvd, and .vtx together, and recompile into place instead of copying individual files around.
The model loads with purple-and-black textures.
The geometry is fine and the materials are unresolved. Work the texture chain: VMT present, VTF present, folder spelling identical, and $basetexture matching the actual file name without extension.
The model loads but will not pose or animate.
The skeleton is the suspect. When an animation SMD names a bone the reference skeleton does not have, the log reports it as an unknown bone error. Re-export the reference and the animations from the final rig, then recompile.
The prop arrives microscopic or enormous.
That is an export-scale problem. Apply the object’s scale in Blender, re-export, and recompile; the compiler faithfully preserves whatever size the exporter handed it.

Characters extend the same QC file with bones, animation sequences, and flex controllers for the face. The export step, the folder rules, and the log-reading habit stay exactly as they are.

The same compiler serves the rest of the Source family. Point Crowbar at a different game configuration and the crate compiles into Garry’s Mod the same way it compiled into SFM, because the QC language and studiomdl belong to the engine, not to one program. A clean crate compile proves the whole chain works; the first character is the same pipeline with more lines in the QC.

Share This Article
Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *