Source Filmmaker

Source Filmmaker

102 ratings
Creating animation presets
By Rantis
Animaiton presets are those little sliders on the top left of SFMs GUI. They can be used to "save" positons of bones or any other animaitonset to be resued at your convenience.
2
   
Award
Favorite
Favorited
Unfavorite
Intro
What are animation presets?
Animation presets are sliders that can control various aspects of a model, normally they control facial expression, phonemes, and visemes.

However, presets can be used to do much more.

This cube model has 30 individual feather bones that would be difficult to animate without the aid of presets.

Normally presets are loaded when the model they were created for is spawned inside the SFM. I will show you how to create animation presets and export them into .pre files which the SFM will automatically load whenever the model they were created for is spawned inside the SFM.

Things to consider when creating presets:
Presets and Python rigs have a strange relationship.

- If a bone is defined in a python rig then then the rigs motion will overwrite the preset, that is to say adding a python rig will break the presets on any bones that are manipulated by the rig.

- Bones that are NOT manipulated in a python rig can still be manipulated by the presets

- If you want presets and python rigs to work in harmony, the bones that you make a preset for cant be defined in the python rig you make for the model

- The only exception to this rule is finger bones, finger bones will work with presets regardless of whether a python rig is attached or not.
Part 1: SFM Setup
First create a new scene, load the map, and spawn the model you want to create presets for.
DO NOT ATTACH A PYTHON RIG TO IT


Then create a keyframe for all of the bones in the graph editor.

Move forward in time (it does not matter how much) and begin posing the bones into the positions that will become the maximum strength of the presets we will create.


Once you have created all of the preset "pose variants" you can begin creating the presets.


Select ONLY the bones that you want your preset to affect and Right Click > Create Preset


You will be given a prompt, You can name either whatever you want, but note that presets with the same Preset group name will share a tab, just something to consider if you ever make a film with a custom model and a valve hwm model.


Once you have created all of your presets you should test them to see if they work correctly.
Part 2: Exporting from SFM
CONGRATULATIONS! You have created presets.
BUT WAIT! We aren't finished yet!
We still need to export them and associate them with the model so sfm loads them automatically every time we spawn it.


Once all of your presets have been created and you are satisfied with them right click on the model, go to Show in Element Viewer > AnimaitonSet.


In the Element viewer find the presetGroups element array and expand it, you should see all of the Preset groups you created.


Right Click on them and click Export Element. EXPORT EACH ONE INDIVIDUALLY


It does not matter where you save them, save them someplace that is easy to get to and you will remember.
Part 3: Into DMXedit
Once you have exported all of the presets as dmx you can close down the SFM.

Launch a command prompt window (type cmd in you start menus search bar)


Once you have launched the command prompt change the directory to your SFMs SDK folder
cd "C:\Program Files (x86)\Steam\SteamApps\common\sourcefilmmaker\game\bin"


Next we will launch a program that will convert our .dmx presets into proper .pre files.

To do this type:
dmxconvert -i "Path/to/the.dmx" -o "Path/to/the.pre" -of preset

Where dmxconvert is the executable program,
-i is the input file, that is the dmx we created earlier
-o is the output file which will be the final .pre file In order for sfm to associate a preset file with a model the output file should be named after the model it was created with and saved in the same directory as the .mdl, for example a preset for derp.mdl will be called derp_emotion.pre
-of is the output format, we want to convert this dmx into a pre file so the output format will be preset

Lets look at an example:
dmxconvert -i "C:\Program Files (x86)\Steam\SteamApps\common\sourcefilmmaker\game\Source Studio\elements\sessions\Scripts\Rantis\guns.dmx" -o "C:\Program Files (x86)\Steam\SteamApps\common\sourcefilmmaker\game\Source Studio\models\npcs\hwm_personality_turret_skins_guns.pre" -of preset


Note: If you simply type dmxconvert and press enter you will see a list of all the available commands, file types and encoding types that dmxconvert can change for you.

If you did everything correctly you should see .pre files in your models folder.


If you create a new scene and load the model in sfm, the presets you created should also load and be ready to go!
Done!
CONGRATULATIONS! You have created, and exported presets!

Happy Animating!

http://steamcommunity.com/groups/OpenSourceFilmmaker/discussions/2/846942156023407287/
16 Comments
ArisDaHotdog. Mar 27 @ 2:34pm 
Can i add more poses to presets after they are made without using cmd because i have a preset for a hand and the 1 pose is a closed fist but i want to add holding gun and pointing pose, but i dont want to use cmd again
nudle Mar 23 @ 10:02am 
how do i import presets into models in sfm cuz im a pussy and would rather do that every time than touch the console
Kenom Mar 13, 2023 @ 5:25pm 
Same issue as Gholdengo
Scary Barry Jun 22, 2022 @ 7:29am 
For some reason I am not able to get this to work. The presets work in the session where I create them. Then when I go through the process of changing the dmx into a pre file, the pre appears in the model's folder. The pre file is named the same thing as the model... Yet the presets don't load when I spawn the model into a new session. Could a specific model theoretically have some problem with loading presets or should this work with any custom model in SFM?

Thanks!
Dallas White Nov 19, 2020 @ 4:19pm 
Does this only work when you create a fresh session, and then spawn the models in question? I ask because I noticed (at least for me) that any created presets won't appear in a preexisting session containing the respective models.
Rantis  [author] Mar 28, 2020 @ 11:07am 
the .pre file is named the same as the model it shouldnt attach to other models
Candle Mar 17, 2020 @ 7:32am 
How do you remove Presets?

Also, is there a way to make presets only appear on the models they work for? Like in the example you've used with the Turret. The presets only work on the turret. Would there be a way to prevent the presets appearing needlessly on all models?

Thanks for the tutorial, never noticed this existed by the way.
Rantis  [author] Oct 13, 2019 @ 10:06am 
nope :(
ArmoredRingo Oct 13, 2019 @ 5:12am 
Hello! this works for saving Models and items attached to them? Let's say i have a tf2 heavy with all the cosmetics ready and i wanna save that to use it on another project. It is possible? and if its not, there is any tool in the workshop that it would help on what i need? (also the items i need dont appear on the "add team fortress item")
Jeffresh Jul 15, 2019 @ 4:48pm 
Took me like a day to figure out why it wasn't working
Turns out for anyone reading this.
If your "Create Presets" option is greyed out
For me it meant it wasn't set as a keyboard bind/shortcut found under the "Help" menu
I set my bind for "Creating presets" and it worked just fine for me.

Thanks for the tutorial, i know it's a late post and there's nothing else i could find on creating presets.