Source Filmmaker

Source Filmmaker

(◣_◢) Sep 24, 2021 @ 8:29pm
Blender to SFM Slider range
Need a little help with something. So I took a model with no facial flexes, exported it to blender, and added the flexes. I exported it as a dmx file. Used crowbar to compile it. Then opened it up in sfm. My facial sliders are there.

Sort of.

So just as an example, the jaw slider. I created in blender and assigned it as bottom value -1 and top value 1. And in blender I can slide between the two and watch him open his mouth and or clip his lips through one another. But when I put it into sfm, the slider only goes from 0 to 1 and I can't remap it to -1 to 1.

So, what do I do to make it so that I get a -1 to 1 range for sfm?
< >
Showing 1-10 of 10 comments
Zappy Sep 25, 2021 @ 2:26am 
Originally posted by (◣_◢):
- So, what do I do to make it so that I get a -1 to 1 range for sfm?
You have to separate it into two shape keys (one for the "positive" jaw movement and one for the "negative"), and assign them to the same flex controller.

Let's say that you've called the shape keys "JawUp" and "JawDown", while you want the flex controller in Source Filmmaker to be called "JawV".


First, go to the "Scene Properties" tab in Blender, find the "Source Engine Exportables" category, select your collection (and object?), and switch from "Simple" to "Advanced" in the "Flex Properties" area.

If you're not already using advanced flexes, click on the "Generate Controllers" button. This is supposed to make a new text block in the Blender Session containing flex controller settings, but it doesn't work for me.

Then switch to the text editor view, select that embedded text block (if it works for you), find the part with your jaw flexes, which will look something like...
"DmeCombinationInputControl" { "id" "elementid" "1fbf6fb1-e80b-4f17-b002-af4f7aca5721" "name" "string" "JawUp" "rawControlNames" "string_array" [ "JawUp", "JawDown" ] "stereo" "bool" "0" "eyelid" "bool" "0" "wrinkleScales" "float_array" [ "0", "0" ] }, "DmeCombinationInputControl" { "id" "elementid" "ba0c638a-2edd-46df-9710-cb5dc83e673a" "name" "string" "JawDown" "rawControlNames" "string_array" [ "JawDown" ] "stereo" "bool" "0" "eyelid" "bool" "0" "wrinkleScales" "float_array" [ "0" ] },
...then replace those two separate controllers with something like...
"DmeCombinationInputControl" { "id" "elementid" "1fbf6fb1-e80b-4f17-b002-af4f7aca5721" "name" "string" "JawV" "rawControlNames" "string_array" [ "JawUp", "JawDown" ] "stereo" "bool" "0" "eyelid" "bool" "0" "wrinkleScales" "float_array" [ "0", "0" ] },
(Here, "name" is the flex controller/slider name shown in Source Filmmaker, and "rawControlNames" is the shape key name(s) in Blender.
If you list two shape keys, it'll make a slider that has the first shape key on the left and the second shape key on the right.
If you list more than two shape keys, it'll make a "multi_" slider that decides which shape key to use, and another slider that decides the intensity/how much to apply it.)
(◣_◢) Sep 27, 2021 @ 7:43pm 
Ok, I'm not sure if it's not working for me either or if I'm doing something wrong. But when I hit Generate Controllers, the destination box turns red and it says DMX written to text block "flex_Face". I've actually hit it a few times and reached "flex_Face.009". I've checked the destination folder as well as several other locations but can't find anything named this.

Zappy Sep 28, 2021 @ 6:52am 
Originally posted by (◣_◢):
- it says DMX written to text block "flex_Face". I've actually hit it a few times and reached "flex_Face.009". I've checked the destination folder -
Text blocks are stored within the Blender session. Switch from a 3D view to a text view, then you should be able to find it in a drop-down list or such somewhere if it worked (which, judging by the way that it increments when you keep pressing the button, it sounds like it did... but then I don't think that that box should have turned red?).
(◣_◢) Oct 22, 2021 @ 6:22pm 
Alright, I'm so close. I got it to have a mid range slider. But it only has a single value as 0.5 that slides back and forth.
Example is if I click on a bog standard model's JawV it comes up single value 0.5 that I can slide left or right. But if I double click on the CheekH is has two values both of which are 0.5. My CheekH only has the single 0.5 value.


"DmeCombinationInputControl" { "id" "elementid" "7bed3f27-2c53-392f-b71a-c22d4ec8b119" "name" "string" "CheekH" "rawControlNames" "string_array" ["CheekHIn", "CheekHOut"] "stereo" "bool" "0" "eyelid" "bool" "0" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0.5", "0.5"] },

Zappy Oct 23, 2021 @ 2:56am 
Originally posted by (◣_◢):
- if I double click on the CheekH is has two values both of which are 0.5. My CheekH only has the single 0.5 value. - "stereo" "bool" "0"
Simply change...
"stereo" "bool" "0"
...to...
"stereo" "bool" "1"
...if you want it to have separate left and right values.
(◣_◢) Oct 24, 2021 @ 6:38pm 
Alright. If all goes well this should be the last two.

So below is the smile. I'm trying to get these sliders as close as possible to the SFM face sliders so I can do the lip sync. The smile in SFM has two values of left and right and is set at default zero. I got the left and right bit working but it is defaulting at 0.5. Also, the movement seems...exponential. Below 0.5 the movement of the mouth is incredibly small. But above it quickly rises into a smile. Comparatively, normal sfm models have it move at a constant pace.

"DmeCombinationInputControl" { "id" "elementid" "17296f06-401e-33c6-87c5-b05d4fc59428" "name" "string" "Smile" "rawControlNames" "string_array" ["SmileLeft", "SmileRight"] "stereo" "bool" "1" "eyelid" "bool" "1" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0.0", "0.0"] },


Alright. Last bit. So the LipsV. In SFM it's broken down into left and right. Also the slider is defaulted to 0.5 with 0-0.5 being the lips being pressed together and 0.5-1 being the lips opening.

Will this code accomplish that? I've compiled and run it but I honestly cannot tell since the lip movement seems very muddled compared to what I had in blender.

"DmeCombinationInputControl" { "id" "elementid" "abcec0b2-2c92-384a-b716-a68bd58cfd2d" "name" "string" "LipsV" "rawControlNames" "string_array" ["LipVLeftClose", "LipsVLeftOpen", "LipsVRightClose", "LipsVRightOpen"] "stereo" "bool" "1" "eyelid" "bool" "1" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0.0", "0.0", "0.0", "0.0"] },
Zappy Oct 25, 2021 @ 8:44am 
Originally posted by (◣_◢):
- "rawControlNames" "string_array" ["SmileLeft", "SmileRight"] -
When you have "SmileLeft" and "SmileRight", are these supposed to be "smile on the left side of the face, and smile on the right side of the face", or "when the Smile slider is set to 0, and when the Smile slider is set to 1"? It works the latter way.

You're not supposed to make your own left and right variants of flexes; that happens automatically (based on a single shape key that affects both sides of the face) when "stereo" is set to 1.

Originally posted by (◣_◢):
- "eyelid" "bool" "1" -
You probably shouldn't set "eyelid" to 1 for non-eyelid flexes.
(And even for eyelid flexes, you should keep it at 0 unless you know what it does.)

Originally posted by (◣_◢):
- Also the slider is defaulted to 0.5 with 0-0.5 being the lips being pressed together and 0.5-1 being the lips opening. Will this code accomplish that? - "rawControlNames" "string_array" ["LipVLeftClose", "LipsVLeftOpen", "LipsVRightClose", "LipsVRightOpen"] -
For that, you would use this code:
"DmeCombinationInputControl" { "id" "elementid" "abcec0b2-2c92-384a-b716-a68bd58cfd2d" "name" "string" "LipsV" "rawControlNames" "string_array" ["LipsVClose", "LipsVOpen"] "stereo" "bool" "1" "eyelid" "bool" "0" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0.0", "0.0"] }
(Combined with a single "LipsVClose" shape key that has the lips closed on both sides of the face, and a single "LipsVOpen" shape key too.
(◣_◢) Oct 25, 2021 @ 7:56pm 
Also, i tmight worth noting. I've been trying to find what I can online. I have below, trying to have one slider control both values. But, It's not working and I can find little on google.

"DmElement" { "id" "elementid" "2ae17c12-9e2b-3209-8579-7edf394fee76" "name" "string" "Smile" "combinationOperator" "DmeCombinationOperator" { "id" "elementid" "abf1cb59-35d1-357f-af08-2163d79d804d" "name" "string" "combinationOperator" "controls" "element_array" [ "DmeCombinationInputControl" { "id" "elementid" "17296f06-401e-33c6-87c5-b05d4fc59428" "name" "string" "SmileRight" "rawControlNames" "string_array" ["SmileRight"] "stereo" "bool" "0" "eyelid" "bool" "0" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0.0"] }, "DmeCombinationInputControl" { "id" "elementid" "21b35e0f-50e1-36ab-a306-9d1308b3a8fc" "name" "string" "SmileLeft" "rawControlNames" "string_array" ["SmileLeft"] "stereo" "bool" "0" "eyelid" "bool" "0" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0.0"] } ] "controlValues" "vector3_array" [] "controlValuesLagged" "vector3_array" [] "usesLaggedValues" "bool" "0" "dominators" "element_array" [] "targets" "element_array" [] } },
Last edited by (◣_◢); Oct 25, 2021 @ 8:01pm
(◣_◢) Oct 26, 2021 @ 6:01am 
Originally posted by Zappy:
You're not supposed to make your own left and right variants of flexes; that happens automatically (based on a single shape key that affects both sides of the face) when "stereo" is set to 1.

Ignore the previous post because it was made when the forums didn't update your reply. But this was the final piece. Don't know why the face can't have its phenomes extracted but I can always copy and paste from another face model.

Thank you SO MUCH!!!!!
I would never have figured this out on my own.
Last edited by (◣_◢); Oct 26, 2021 @ 6:01am
Zappy Oct 26, 2021 @ 7:56am 
Originally posted by (◣_◢):
- Don't know why the face can't have its phenomes extracted but I can always copy and paste from another face model. -
Your model doesn't have phoneme presets (which is both shown in the top-right of the Animation Set Editor and used for phoneme extraction).

If your model has the same "set" of flexes as another model that does have phoneme presets (and the model is from Valve or another "free-to-use" source), you can try finding that model in File Explorer, then copy its "[filename]_phoneme.pre" file to where your own MDL file is, and rename it to the name of your model followed by "_phoneme.pre".

(For Team Fortress 2's HWM class models, you should look in the "tf" search path, not "tf_movies".)


Edit: After this, you should make a new session and test the model there.
(Presets are only loaded when you make a new animation set, and I don't know if it works if you make a new animation set for a model that you've already used in the same session, so making a new session to check is nice.)
Last edited by Zappy; Oct 26, 2021 @ 7:59am
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Sep 24, 2021 @ 8:29pm
Posts: 10