Get SFM ↗
ARTICLE / December 3, 2026

SFM Compilation Guide: How to Compile Models for Source Filmmaker

By Joseph Briar

Computer screen showing a 3D character model viewport during compilation

Every custom model in Source Filmmaker starts with sfm compilation. It is the step that makes models usable. Without it, SFM cannot load your work. With it, your model appears in scenes. This guide explains the process step by step. It covers files, tools, and common errors.

Source Filmmaker is Valve’s free animation tool. It runs on the Source engine. The engine needs compact, ready model data. Your 3D program saves editable project data. Those two formats do not match. Compilation bridges the gap between them.

What Is sfm compilation?

Put simply, sfm compilation converts source files. It turns meshes, bones, and scripts into engine files. The main output is the MDL model file. Support files carry vertex and physics data. SFM loads the finished set as one model.

The process uses Valve’s StudioMDL compiler. You feed it a QC script. The script lists every input file. StudioMDL reads the script carefully. It then builds the compiled output. Crowbar offers a visual way to run it.

Compilation is not the same as rendering. Rendering exports your finished film. Compilation prepares assets before animation. You compile once per model version. You render once per finished scene. Keep these two steps separate.

Files You Need Before You Start

Good preparation makes compilation smooth. Gather every file in one project folder. Keep names short and lowercase. Avoid spaces in folder names. Spaces break paths in scripts. Simple names prevent silly errors.

File TypePurpose
SMDStores mesh, skeleton, or animation data.
DMXStores structured model and animation data.
QCTells the compiler how to build the model.
VTFHolds the actual texture image data.
VMTDescribes the material and its texture path.
MDLThe compiled model file SFM loads.

SMD and DMX are source formats. MDL is the compiled result. The QC file connects the two sides. Textures travel their own small path. Images become VTF files first. VMT scripts point the model to them.

Tools Required for Compilation

Five tools cover the whole process. All of them are free. Download each from its official page. Keep versions reasonably up to date. Old versions cause strange errors.

ToolRole in Compilation
StudioMDLThe official compiler. It builds MDL files from QC scripts.
CrowbarA visual front end. It runs StudioMDL with buttons and logs.
Blender Source ToolsExports meshes and animations as SMD or DMX.
VTFEditConverts images into VTF texture files.
HLMVPreviews compiled models with textures and bones.

StudioMDL ships with Source tools on Steam. SFM itself includes the toolchain. Crowbar comes from its GitHub page. Blender Source Tools has an official page. Official sources keep downloads safe.

Step by Step: Compiling a Model

The full process has six clear steps. Follow them in order every time. Do not skip the testing step. Testing catches problems early. Early fixes cost minutes, not hours.

Step 1: Prepare the model. Finish the mesh in Blender. Clean up stray vertices and faces. Complete the UV map fully. Add bones if the model will pose. Paint weights on every vertex. Check scale against SFM units.

Step 2: Export the source files. Use Blender Source Tools to export. Save the reference mesh as SMD or DMX. Save each animation separately. Keep bone names consistent across files. Mismatched names break animations later.

Step 3: Convert the textures. Open each image in VTFEdit. Save it as a VTF file. Write a matching VMT script. The VMT names the texture path. Place both files in materials folders. Match folder names with your QC later.

Step 4: Write the QC file. Open a plain text editor. Start with the $modelname command. It sets the output model path. Add $body to link your mesh. Add $cdmaterials for texture folders. Add $sequence for each animation. Add $collisionmodel for physics if needed.

Step 5: Run the compiler. Open Crowbar and load the QC file. Select the correct game configuration. Click Compile and watch the log. Read every line from the top. Fix the first error first. Compile again after each fix.

Step 6: Test the result. Open the MDL file in HLMV. Check textures and bone movement. Then load the model inside SFM. Pose it in an empty test scene. Save the scene as your test file. Reuse it for future models.

Understanding Key QC Commands

The QC file is small but powerful. Each command controls one build detail. Learn the core commands first. Advanced commands can come later. Keep your first QC files simple.

QC CommandWhat It Does
$modelnameSets the compiled model name and folder.
$bodyLinks the main mesh file to the build.
$cdmaterialsPoints to the texture folders for materials.
$sequenceAdds an animation sequence to the model.
$collisionmodelDefines the physics collision mesh.
$surfacepropSets the surface type, like metal or wood.

Paths inside the QC need care. Use forward slashes in paths. Match folder names exactly. One wrong letter breaks the build. Copy paths from your file manager. Pasting beats typing every time.

Output Files After Compilation

A successful build creates several files. They always travel as a set. The MDL file is the main one. The VVD file holds vertex data. VTX files hold rendering data. A PHY file holds physics data. PHY appears only with collision defined.

Place outputs in the right game folders. Models go in the models folder. Materials go in the materials folder. SFM searches these folders at startup. Wrong placement hides your model. The compile log shows output paths. Follow them exactly.

Common Compilation Errors and Fixes

Errors are normal during learning. The log tells you what failed. Read it slowly, line by line. Most fixes take under a minute. Panic helps nobody here.

File not found errors. A path in the QC is wrong. Check spelling and folder names. Keep source files beside the QC. Relative paths reduce mistakes. Compile again after correcting paths.

Missing texture in SFM. The VMT path is likely wrong. Open the VMT and check its path. Confirm the VTF sits in that folder. Match $cdmaterials with the same path. One consistent path fixes it.

Model shows as ERROR. The MDL file is missing or invalid. Confirm the compile truly succeeded. Check the output folder from the log. Make sure SFM reads that folder. Move files if needed.

Too many vertices or bones. The engine has fixed limits. Simplify the mesh in Blender. Merge bones where possible. Split huge models into parts. Compile each part separately.

Broken or stretched animation. Bone weights are usually the cause. Repaint weights on problem areas. Ensure every vertex has weight. Re-export and compile again. Test one simple pose first.

Tips for Faster, Cleaner Builds

Keep a starter QC template ready. Copy it for each new model. Edit only names and paths. Templates prevent forgotten commands. They also keep builds consistent.

Compile small test models first. A simple box teaches the flow. You learn logs without pressure. Then compile your real model. Confidence grows with each success. Keep notes on every fix.

Organize folders from day one. One folder holds one project. Sources and outputs stay separate. Backups live in a third folder. Tidy projects compile faster. Messy projects waste evenings.

For more step by step help, visit our homepage. It links guides for each workflow stage. Read one guide, then practice it. Practice turns reading into skill. Skill makes compilation routine.

Materials and Textures in Detail

Textures deserve their own careful pass. A model can compile perfectly. It can still look wrong in SFM. The problem usually sits in materials. Check materials before blaming the mesh. Most visual bugs live there.

Each material needs a VMT script. The script names one VTF texture. It can also set surface settings. Settings control shine and transparency. Keep early VMT files very simple. Add advanced settings one at a time. Test after each change.

Texture size matters for performance. Huge textures slow down scenes. Match size to the model’s role. Small props need small textures. Hero characters can use larger ones. Balance quality with scene speed. Your future renders will thank you.

Keep material names consistent everywhere. The mesh, VMT, and folders must agree. One mismatch creates checkerboard squares. Search your files when in doubt. Consistent naming prevents this classic bug. It is the most common fix of all.

Compiling Maps Versus Models

Maps compile through a different tool. The map compiler builds BSP files. It handles geometry, lights, and visibility. Model tools do not build maps. Keep the two workflows separate. Mixing steps causes confusion fast.

Model compilation stays focused on assets. Characters, props, and weapons live here. Map compilation builds whole environments. SFM scenes combine both results. You load a compiled map first. Then you place compiled models inside. Each side does its own job.

Learn model compilation first as a beginner. It teaches files, paths, and logs. Those skills transfer to map work later. The habits are the same. Tidy folders and careful paths win. Both compilers reward patience.

When Should You Recompile?

Recompile after any source change. Mesh edits need a fresh build. New animations need a fresh build. Changed QC paths need one too. The MDL never updates itself. You must run the compiler again.

Keep old builds until new ones pass. Test the new build in HLMV first. Then test it inside SFM. Only then replace the old files. This habit prevents broken scenes. Rollback stays one copy away.

Version your project folders simply. Add numbers like v1 and v2. Note what changed in each version. Short notes beat memory every time. You will revisit old projects. Clear versions make that painless.

Building a Repeatable Routine

Routine turns compilation into a habit. Use the same folder layout always. Use the same naming style always. Use your QC template every time. Consistency removes whole error classes. Your builds become boring, in a good way.

Write a tiny personal checklist. Export, textures, QC, compile, test. Tick each step as you finish. Checklists catch skipped steps early. Pilots use them for a reason. Creators benefit the same way.

Soon the process feels automatic. Errors still happen sometimes. Now you read logs with calm eyes. You fix paths in seconds. You help other beginners too. That is real progress.

Keep your tools updated as well. New Crowbar versions fix old bugs. New add-on versions export cleaner data. Check for updates every few months. Update one tool at a time. Test a small model after updating. Careful updates avoid new surprises.

Finally, enjoy the creative side. Compilation is only the doorway. Animation is the real destination. Every compiled model opens new scenes. Every scene teaches new skills. The pipeline serves your stories. Keep building, keep compiling, keep creating.

FAQs

What is sfm compilation in simple words?

It converts raw 3D files into engine files. StudioMDL builds MDL models from QC scripts. SFM loads the compiled result. Without this step, models stay invisible.

Do I need Crowbar to compile models?

No, StudioMDL works on its own. It runs from the command line. Crowbar adds a friendly visual window. Both produce identical output files. Beginners usually prefer Crowbar.

Which is better, SMD or DMX?

Both formats compile correctly. SMD is older and widely used. DMX supports newer features. Either choice works for SFM. Pick one and stay consistent.

Why does my compiled model lack textures?

The material path is probably wrong. Check the VMT file contents. Check the VTF file location. Match $cdmaterials to the same folder. Fix paths, then compile again.

Can I compile animations the same way?

Yes, animations compile with the model. Export each animation as SMD or DMX. List them with $sequence commands. StudioMDL bakes them into the MDL. SFM plays them from the model.

How long does one compile take?

Most compiles finish within seconds. Large models take slightly longer. Setup and fixes take the real time. Templates make later builds faster. Practice makes the process routine.