STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
301
IN-GAME
1,855
ONLINE
Founded
8 November, 2013
All Discussions > Help > Topic Details
SD 12 Sep, 2021 @ 7:53am
Possible to disable corrective shape key checks for Source 2 exports?
In order to author stereo flexes in modeldoc. Shape keys must be exported with Left_ and Right_ prefixes. The current version of BST will always define shape key names with "_" as a corrective shape while in Source 2 corrective shapes are defined with "__". Would it be possible to disable this check or update it specifically for Source 2?

I've recently figured out that Source 2 can still accept wrinklescales for individual shapekeys rather than relying on ComputeWrinklescales, but this becomes problematic when the flex controllers only accept default shape key names with no underscores.
Last edited by SD; 12 Sep, 2021 @ 11:10am
Originally posted by Artfunkel:
I just pushed changes to GitHub which include support for ModelDoc corrective shapes. To enable it, either set your engine path to HLVR's bin64 directory, or manually select "Model 22 (ModelDoc)" as your DMX format.

Please let me know if this fixes the problem, and whether there is anything else that the Tools could do to make life easier in this area.
< >
Showing 1-10 of 10 comments
Zappy 12 Sep, 2021 @ 8:37am 
For Source 1, there's a difference between a "flex" (shape key) and a "flex controller" (the slider/input in Source Filmmaker/Garry's Mod/other games).
You can then use "advanced" DMX flexes to give a "flex controller" (the "name" in the flex definitions) a different name than its "flex" (the "rawControlNames").

With this, you can name a shape key as "Left-Example" and "Right-Example", then do something like this in the flex definitions...
"DmeCombinationInputControl" { "id" "elementid" "ee4bf229-d43a-3a8c-bdd2-5804d0dd1263" "name" "string" "right_Example" "rawControlNames" "string_array" ["Right-Example"] "stereo" "bool" "0" "eyelid" "bool" "0" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0"] }, "DmeCombinationInputControl" { "id" "elementid" "1322da48-cd70-3e12-8f28-a1e4476b13ad" "name" "string" "left_Example" "rawControlNames" "string_array" ["Left-Example"] "stereo" "bool" "0" "eyelid" "bool" "0" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0"] },
...and then Source Filmmaker will treat it as a single stereo flex.


I'm not proposing this as a "fix", just a "workaround", and I don't know if it works this way in Source 2.
SD 12 Sep, 2021 @ 10:57am 
Originally posted by Zappy:
For Source 1, there's a difference between a "flex" (shape key) and a "flex controller" (the slider/input in Source Filmmaker/Garry's Mod/other games).
You can then use "advanced" DMX flexes to give a "flex controller" (the "name" in the flex definitions) a different name than its "flex" (the "rawControlNames").

With this, you can name a shape key as "Left-Example" and "Right-Example", then do something like this in the flex definitions...
"DmeCombinationInputControl" { "id" "elementid" "ee4bf229-d43a-3a8c-bdd2-5804d0dd1263" "name" "string" "right_Example" "rawControlNames" "string_array" ["Right-Example"] "stereo" "bool" "0" "eyelid" "bool" "0" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0"] }, "DmeCombinationInputControl" { "id" "elementid" "1322da48-cd70-3e12-8f28-a1e4476b13ad" "name" "string" "left_Example" "rawControlNames" "string_array" ["Left-Example"] "stereo" "bool" "0" "eyelid" "bool" "0" "flexMax" "float" "1.0" "flexMin" "float" "0.0" "wrinkleScales" "float_array" ["0"] },
...and then Source Filmmaker will treat it as a single stereo flex.


I'm not proposing this as a "fix", just a "workaround", and I don't know if it works this way in Source 2.
Doesn't work like this unfortunately. I tried it, Modeldoc will instead create a duplicate flex controller with underscores while the controller defined in the dmx text file has no function/ slider doesn't work
https://imgur.com/a/pB7r8Ef
Last edited by SD; 12 Sep, 2021 @ 11:11am
Rabbitfox 13 Sep, 2021 @ 3:34pm 
For stereo flexes, can't you just set the "stereo" "bool" in the DMX file to "1" instead of "0" for the flexes in question? Works for me in Source 2 and I don't need the left/right prefix then. Also where did you get the information that corrective flexes are defined with "__"? I tried that out and Source 2 doesn't recognize that as a corrective flex, it just makes a separate controller with the two underscores in it.
SD 13 Sep, 2021 @ 3:49pm 
Originally posted by Rabbitfox:
For stereo flexes, can't you just set the "stereo" "bool" in the DMX file to "1" instead of "0" for the flexes in question? Works for me in Source 2 and I don't need the left/right prefix then. Also where did you get the information that corrective flexes are defined with "__"? I tried that out and Source 2 doesn't recognize that as a corrective flex, it just makes a separate controller with the two underscores in it.
The stereo bool still works fine. The issue is that modeldoc for some reason doesn't correctly use the Stereo flex balance causing the left flexes having parts of the right flexes move and vice versa. This also breaks how wrinkle maps behave as they appear on opposite wrong sides.

A video demonstrating this: https://streamable.com/h4f3pw
Corrective shapes as defined in modeldoc is "Morph combination shape". The description states: https://imgur.com/a/CNqbINE

You can see a majority of what im talking about if you open an HLA character in modeldoc
Last edited by SD; 13 Sep, 2021 @ 3:50pm
Rabbitfox 24 Sep, 2021 @ 8:02am 
Did you adjust the Stereo Flex Balance Sharpness when exporting from Blender? Just for a test I set it to 100% and model doc then strictly only flexes the desired side. I normally use around 98% and it works ok. Also couldn't you just create separate left/right flexes in Blender, name them something, export them, define a stereo Morph Control in ModelDoc and then define MorphRules that assign your left/right flex to the stereo Morph Control you created? That way no changes would be needed in the Blender Source Tool, just more work later in ModelDoc.
Last edited by Rabbitfox; 24 Sep, 2021 @ 8:03am
Artfunkel 4 Dec, 2021 @ 3:37am 
Thanks for this information. It's hard for me to support this version of the engine as I have no VR hardware, which makes buying Half-Life: Alyx a bit pointless.

Unfortunately the "biped_standard_model" sample DMX files that I have from the Alyx SDK are version 22, which is the same as for earlier Source 2 versions (which use a single underscore). That makes it hard to differentiate between the two.

Does anyone know of a sample DMX file for this build of the engine which includes flexes?
Last edited by Artfunkel; 4 Dec, 2021 @ 3:38am
Smug Bastard 5 Dec, 2021 @ 2:43am 
Unfortunately I don't think there are any examples in Alyx SDK. Would a decompiled blender version of HLA character (f.e. GMan) be of any use?
Artfunkel 5 Dec, 2021 @ 8:19am 
Unfortunately no, that would only tell me what the author of the third-party decompiler knows. What I'm really interested in seeing is whether version 23 of the DMX model format exists and is supported by the engine.

It looks like I'll just have to add double underscore as a manual setting in the exporter.
Artfunkel 5 Dec, 2021 @ 9:09am 
Oh boy, things get confusingif you want to use an older DMX with single underscores in modeldoc. Why did you do this, Valve?!
A moderator of this forum has indicated that this post answers the original topic.
Artfunkel 29 Jan, 2022 @ 10:27am 
I just pushed changes to GitHub which include support for ModelDoc corrective shapes. To enable it, either set your engine path to HLVR's bin64 directory, or manually select "Model 22 (ModelDoc)" as your DMX format.

Please let me know if this fixes the problem, and whether there is anything else that the Tools could do to make life easier in this area.
< >
Showing 1-10 of 10 comments
Per page: 1530 50

All Discussions > Help > Topic Details