SFM to PFM Workflow
This workflow describes the general approach if you want to import a SFM project into Pragma and render it. There are a few things to take into consideration:
- SFM and PFM are not entirely compatible, which means that importing a SFM project into Pragma will likely result in significant differences (e.g. in terms of lighting) and will require some manual adjustments.
- Try to avoid large, complex projects and/or maps. Smaller projects on smaller maps (or scene builds) tend to work better.
- The Meet-the-Team sessions that are shipped with SFM are not supported, as they are based on older versions of the SFM project file format. They may partially work, or not at all.
- Fake PBR models are not compatible with PFM, because they abuse the specific rendering methods that SFM uses. If you don't know what fake PBR is, it will most likely not be a problem.
Now that that's out of the way, there are two things have to take care of before you can import your SFM session into PFM:
Geting your SFM Project ready
Detach IK Rigs
PFM does not support SFM IK rigs. If your animation uses any IK rigs, you have to follow these steps in SFM first:
1.) Make sure all transforms for all actors are unlocked:
2.) Detach all rigs from all actors that have one:
3.) Save the session.
Set up Mount location
If your SFM projects are located in one of the default SFM locations (e.g. common/SourceFilmmaker/game/usermod/elements/sessions
), then PFM should be able to find them by default. However, if they are under a custom location (e.g. SourceFilmmaker/game/ninja12r
), you will have to do the following to allow Pragma/PFM to find them:
- Open
Pragma/cfg/mounted_games.udm
in a text editor - Find the following entry:
"sfm"
{
$bool enabled 1
$string localization_name "mount_game_sfm"
$int32 priority 950
"steam"
{
$uint32 app_id 1840
$array game_paths [string][
"common/SourceFilmmaker/game/usermod/",
"common/SourceFilmmaker/game/workshop/",
"common/SourceFilmmaker/game/tf_movies/",
"common/SourceFilmmaker/game/tf/",
"common/SourceFilmmaker/game/hl2/",
"common/SourceFilmmaker/game/left4dead2_movies/",
"common/SourceFilmmaker/game/platform/",
"common/SourceFilmmaker/game/portal2/"
]
$bool mount_workshop 1
}
"engine"
{
$string name "source_engine"
}
}
- Add the custom location to the
game_paths
list. For instance, if your project files are located incommon/SourceFilmmaker/game/ninja12r/elements/sessions/
, then the path you should add is "common/SourceFilmmaker/game/ninja12r/":
Make sure to add the ',' for the previous entry as well, as shown in the screenshot above.
- Save the file and close it.
Importing the SFM Session
Once you've completed the previous steps, you're ready to start Pragma. Double click pragma.exe
and click New Game
. Here you will have to select the map that was used for the SFM session, as well as Filmmaker
for the Game Mode
. Now click Start Game
. If this is your first time loading the map, the map and its assets will have to be converted to Pragma's formats first, which may take several minutes or more, depending on the map's size and complexity.
Once the map has been loaded, you should be greeted by the PFM interface. You can now import the SFM project from the menu bar via File > Import > SFM Project
. Once again, this may require a lot of asset conversions and may take a while. While it is loading PFM will appear frozen. Eventually you should be able to see your scene pop up in the viewport.
The next step depends on what you're trying to accomplish. If you want to get straight into rendering, you can check out some of the rendering workflow tutorials:
Regardless of your goal, it is also recommended that you familiarize yourself with the user interface, as well as read up on some of the rendering tutorials. Please don't hesitate to ask questions on the Discord server if you're having trouble!
2.) Launch PFM and import the Project
You can launch PFM by launching Pragma, clicking "New Game" and changing the game mode to "Filmmaker".
PFM currently doesn't change the map when importing a SFM session, so you will have to select the map in the "New Game" menu before clicking "Start Game"! If you're loading a map for the first time, Pragma will have to convert the map and all of its assets first, which may take several minutes. This only has to be done once for every map/asset, so loading should be faster next time.
Once the Filmmaker has been loaded, select "File -> Import..." from the menu bar and select your SFM project, then press "Open". This will once again start a conversion process, which may take several minutes (Pragma may appear frozen during this time). After the project has been imported, you can save it in PFM's internal format (".pfm"), which can be loaded a lot faster.
If your SFM session file is located in one of the default sub-directories in "steam/steamapps/common/SourceFilmmaker/game/", your SFM session file should be listed in the import file explorer automatically.If the file is located in a custom location (e.g. "SourceFilmmaker/game/custom/elements/"), you will have to open "Pragma/cfg/mounted_games.txt", locate the "sfm" entry and add your path to the "game_paths" list in the same format as the existing ones. If this doesn't work, you can just copy the session file to one of the default sub-directories (e.g. "SourceFilmmaker/game/usermod/elements/").
Here's an example video on how to load a map / a project:
(The video is from an older video of Pragma / PFM, but the basic approach is still the same.)
For information on how to render your animation with Pragma, check out this article.