Adding Flexes to Bodygroups: Difference between revisions
Sage J. Fox (talk | contribs) (Added details for getting stereo flexes to work on bodygroups. ~~~~) |
|||
Line 4: | Line 4: | ||
[[File:Flex.png|thumb|right|Models that don't use this fix may have extra duplicate flexes that don't do anything at all.]] | [[File:Flex.png|thumb|right|Models that don't use this fix may have extra duplicate flexes that don't do anything at all.]] | ||
If you are modelling characters with | If you are modelling characters with togglable meshes, you may run up to a problem where you will not be able to use flexes/shapekeys on bodygroup models. | ||
An example for this is a model with separate head bodygroups, that's meant to have flex controllers assigned to it. | An example for this is a model with separate head bodygroups, that's meant to have flex controllers assigned to it. | ||
To fix this we are going to use Blender, preferably the latest versions. | To fix this we are going to use Blender, preferably the latest versions. | ||
== The fix == | == The fix == | ||
Assuming you have already created the | Assuming you have already created the shapekeys for your model, and that you have some experience with Blender beforehand, have installed the necessary tools for model editing (Crowbar, Blender Source Tools), simply split the mesh (select the vertices and press P on edit mode) that will be used as a separate bodygroup. | ||
{{note|in order for this to work, both the base model (in my case, the body) '''must''' share the same shapekeys. If they don't, join (select both, CTRL+J) the bodygroup mesh with the base mesh and then separate them again (Hit P in edit mode) and it should work.}} | {{note|in order for this to work, both the base model (in my case, the body) '''must''' share the same shapekeys. If they don't, join (select both, CTRL+J) the bodygroup mesh with the base mesh and then separate them again (Hit P in edit mode) and it should work.}} | ||
[[File:Flexproperties blender.png|thumb|right|Location of the flex properties panel in 2.7x and the latest version]] | [[File:Flexproperties blender.png|thumb|right|Location of the flex properties panel in 2.7x and the latest version]] | ||
Line 41: | Line 41: | ||
[[File:Flex2.png|thumb|Result after the fix]] | [[File:Flex2.png|thumb|Result after the fix]] | ||
== Stereo Flexes == | |||
In order for stereo flexes to work with this method, you will need to manually split them into [flexname]L and [flexname]R versions, with only the left and right sides affected respectively. | |||
{{todo|Tested on Binary 2, Model 1 format for export. Some formats ''might'' need left_ and right_ prefixes instead? (Would these work because of [[Flex_animation#Corrective_shapes|corrective shapes]]?)}} | |||
== References == | == References == | ||
https://web.archive.org/web/20200710074830/https://steamcommunity.com/app/1840/discussions/0/2153224488982782040/ | https://web.archive.org/web/20200710074830/https://steamcommunity.com/app/1840/discussions/0/2153224488982782040/ |
Revision as of 01:02, 25 September 2023

If you are modelling characters with togglable meshes, you may run up to a problem where you will not be able to use flexes/shapekeys on bodygroup models. An example for this is a model with separate head bodygroups, that's meant to have flex controllers assigned to it. To fix this we are going to use Blender, preferably the latest versions.
The fix
Assuming you have already created the shapekeys for your model, and that you have some experience with Blender beforehand, have installed the necessary tools for model editing (Crowbar, Blender Source Tools), simply split the mesh (select the vertices and press P on edit mode) that will be used as a separate bodygroup.

Now in order to ship bodygroups with flexes on them, select the separate bodygroup mesh, go to the flex properties panel and set it from "Simple" to "Advanced". Do not do these steps for the Base mesh. Do this only for the bodygroups that will receive the flex controllers. Next, create a .txt file with the following:
<!-- dmx encoding keyvalues2 1 format model 1 --> "DmElement" { "id" "elementid" "12345678-1234-1234-1234-012345678910" "name" "string" "root" "combinationOperator" "DmeCombinationOperator" { "id" "elementid" "01234567-8910-1112-1314-151617181920" "name" "string" "combinationOperator" "controls" "element_array" [] "controlValues" "vector3_array" [] "controlValuesLagged" "vector3_array" [] "usesLaggedValues" "bool" "0" "dominators" "element_array" [] "targets" "element_array" [] } }
Save this file somewhere and paste its location on the box that says "Controller Source", still on the bodygroup. Then simply export your .DMX meshes. You'll get a warning that says there are missing shapekeys but that can be ignored. Compile your model using Crowbar and this fix should work.
Stereo Flexes
In order for stereo flexes to work with this method, you will need to manually split them into [flexname]L and [flexname]R versions, with only the left and right sides affected respectively.