Source Filmmaker Useful Commands Guide (SFM)

SFM Toolbox playlist

Developed by Valve, SFM is a 3D animation software based on the TF2 Source engine. Its freeware license is the lucrativeness any entering 3D animator will find alluring.

The software is old and is considered abandonware from the community, but it has a large database of assets that can be implemented and utilized.

There is limitation to the assets on the SFM workshop, but then we should take into consideration all mods for Source games, putting focus upon the biggest of them all: Garry’s Mod.

As someone had said in a distant forum: using SFM is a love-hate relationship, the more you hate it, the more you understand it. There are tons of issues revolving around it, and the only way to fix them is to just dig deep or code fixes yourself.

The learning curve is frustrating, but once you comprehend how to add assets, how to disable and migrate them, learning the console commands and practicing animation, you’ll find yourself in a happy place of capability, until one day you find the courage to move to more sophisticated software like Blender.

There’s also the possibility of creating symbiosis between SFM and Garry’s Mod, because where SFM lacks in amount of entities in a map, GMod can easily persevere and outdo itself. But remember that you’ll have to learn the tricks of the trade in GMod as well, since it’s less animation friendly than our beloved SFM software.

SFM is limited by its 32bit architecture, hence, it can only utilize 4GB of RAM or practically tested around 3000-3500MB of RAM. Use mat_reloadallmaterials when near those parameters, otherwise you might experience an explosion.

A good processor is key to using the software without hassle, but you also need a good GPU, because it is based on a game engine and VRAM is also handy for such occasions.

Launch commands

Go into Steam and select Source Filmmaker, but select its properties. In the window that opens, find ‘Set Launch Options’, and insert the commands into it. Nothing is needed to separate different strings of code, just a space.

Such commands are distinguished by the â€“ or + before the command.

Max Quality Render Launch commands

-sfm_resolution 2160 -w 3840 -h 2160 (sets preview and render output to 4k)
+mat_forceaniso 16 (anisotropic filtering, gives clarity and sharpness to textures when viewed from angles)
-sfm_shadowmapres 8192 (caps the shadow map resolution, increasing quality)
-reflectiontexturesize 1024 (result in sharper and more detailed reflections)
+mat_envmapsize 256 (determines the resolution of the environment maps used for reflections. They are textures used to simulate the reflection of the surrounding environment on reflective surfaces, such as shiny objects or metallic surfaces)
-monitortexturesize 1024 (control the maximum size of the rendered textures in relation to your monitor’s resolution)
+flex_smooth 0 (with this, model flexes should stop randomly resetting)
+r_waterforceexpensive 1 (increases water quality)
+mat_wateroverlaysize 1024 (controls the size of water overlays)
+r_waterforcereflectentities 1 (controls the rendering of reflections on water surfaces for certain entities or objects)

ED_Alloc: no free edicts

Entities in maps usually do not cause issues, but when the map is huge, it’s set to create problems for our beloved SFM. Go to your launch options and put the launch code -num_edicts 2047. Do not go over that because it will make your game or software to crash.

If the map keeps crashing, you need to decompile it and reduce the entities. If you have the vmf file, you don’t need to decompile anything. Just remove them with Hammer or through Notepad++

1080p Rendering, Preview

Default values for SFM are 720p, which can be annoying if one wants to increase the crispness of the imagery.

To change it you have to set your SFM launch options to -w 1920 -h 1080 -sfm_resolution 1080 -w 1920 -h 1080. The first –w 1920 –h 1080 is for your preview settings, while the other is for rendering. If you don’t want a 1080p preview, just add the code –sfm_resolution 1080 -w 1920 -h 1080.

Console commands

  • Remove Satan lights which bleed through other objects
    ent_fire env_lightglow kill
  • Dynamic water reflections
    r_waterforcereflectentities 1
  • Refresh all materials in scene and resets RAM use
    mat_reloadallmaterials
  • Remove fog from a map
    fog_override 1 or fog_enable 0

Hiding Water in SFM Maps

Since water in some maps is broken, best course of action is to hide it and put a water model on top, as it would do the job anyways. Note that you can fix this issue in Hammer by finding water texture that can work in symbiosis with SFM, otherwise, just stick to this fix.

Hiding water can be done by typing mat_drawwater 0 which will remove any visible water on your map. But with hiding the water, there’s another problem which comes into play, as now when you go under the hidden water, you will experience underwater effect with fog.

Disabling the underwater effect is done by typing fog_enable_water_fog 0 which will clear everything, as now you have a giant ocean seabed that is in the atmospheric form of the Mad Max universe.

Glowing Textures on Map

There are maps which you will find have issues with bumpmap, giving the properties of eternal glow in the darkness, hence, destroying the atmosphere and setting of the map.

An easy fix is to just set mat_bumpmap 0 in console and enjoy the normality of the faulty map textures. Do know that there are maps, which when you enter this console command, will revert other textures to glow instead. This can be found on gm_fork.

Weird Shiny Lighting Bug

Issue is created by cubemaps. What are they? Textures in a map have reflective capabilities, and without cubemaps they can get quirky or ugly, or incredibly shiny. Such shininess of different colors is when cubemaps are broken.

There are 2 fixes. The fast one and the slow one. Fast one is to type mat_specular 0 (this can sometimes crash the map, so just retry) or mat_fastspecular 0 in console, which will remove all cubemaps from the map.

Removing cubemaps like this can make some shiny textures to look bleak or ugly. There comes the 2nd fix, which can be done by using a tool called CubeMapper. Read the instructions in there if you want a permanent fix.

If disabling specular refuses to work, type buildcubemaps in console and wait for a bit. After the map has rebuilt the cubemaps, type mat_specular 0 again in console. This should’ve fixed it.

Engine Hunk Overflow

This occurs at the attempt of loading a Source map. It’s an issue of Lightmap being with an odd value. It’s an issue with all Source games, like CSGO, GMod, L4D2, HL2, SFM.

Set your game launch option to +r_hunkallocligtmaps 0 or, in SFM, manually type in console r_hunkalloclightmaps 0 and run your map. If the map crashes, check for other solutions, excluding Engine Hunk Overflow, since you’ve already set it to 0.

My viewport is flickering when moving the camera around

Go to SFM’s Launch Options and add the line -usevgui

Otherwise, while in SFM go to Windows > Engine Window > Auto Hide Engine Window

Parts of the map are not appearing, like props and buildings

Hovering over your viewport, right click > Draw Game Entities > Other Entities and similiarly you can activate Particles as well if there are such baked into the map

Objects disappear from the camera before they are out of frame – Culling

There are objects that can just vanish when your camera is moving, or when the object itself is moving. Depending on the object, you might be lucky enough to accept and ignore it, but when it’s obvious, then you need to fix it.

You need to turn off culling by adding $nocull 1 to the material of your object, more specifically in your .VMT file. There doesn’t seem to be any other way.

Read more about culling here – https://developer.valvesoftware.com/wiki/$nocull

Posing fingers lags a lot

Reduce the timeline length below 10 seconds

Playhead bug in the Motion Editor that hijacks all mouse movements

Shift + drag select with the mouse

I can’t import sound files

Convert your sound file to a 16bit .wav at 44100 Hz

Material $commands

$color (vector) – change the color of a material, useful when trying to create different variations of clothing, insignia…
$basetexture (string) – change the texture to another of your choosing
$iris (string) – change the material of the eye, usually related to eye color
$phongboost (float) – apply wetness to your texture and if you want to get a more glossy feel to it like in Team Fortress 2 then use $phongexponent
$basealphaenvmapmask (string) – separate phongmap from the envmap
$bumpmap (string) – add a corresponding bumpmap to your texture
$selfillum (vector) – gives your material an internal glow (self illumination). Useful for special effects or objects that have a light source (candles, car lights, house windows)
$detailblendfactor (normal) – works like $basetexture, but also allows you to put a texture over an already existing one. In order to set it up, add $detail (string) first to a texture. Then add $detailscale (float) to define the texture size, and then add $detailblendfactor (normal) to set the opacity amount

If you like SFM then consider moving to S2FM that’s based on Half-Life: Alyx