Morphs and Shape Key Animations
This page will guide a beginner through the least possible amount of steps required to import new morphs and shape key animations into S&box, as well as have them work and be useable in the Animgraph or Face Poser, it assumes you already know how to create shape keys and navigate Blender, it will not show how to create them as that is related to neither ModelDoc nor S&box, and guides for it already exist online.
We will be using "Blender" as it is the most widely used free modelling program, and the plug-in "Source Export Tools".
- Create the shape keys
- Go to "Scene Properties" and then "Source Engine Export", change "Export Format" to "DMX"
- Use the latest DMX version, as of writing this it's "Binary 9" and "Model 22"
- Select the checked "MeshName.dmx" under "Source Engine Exportables" (in my case "citizen.dmx", check if unchecked)
- Go to "Flex Properties" and press
Exportto export the model.
Generate Corrective Shape Key Driversbefore export.
As mentioned before, morphs are animation-driven, this means that even if morphs will appear when importing the model, you won't be able to use them until there's at least 1 animation. If you planned for this model to be static and/or have no animations, you can simply reuse the model itself as a "Simple Animation".
- Import the Mesh in ModelDoc
- Add any animation, use the model itself if you don't plan on having animations.
- Add a material that supports morphs (in "Material Editor" check the
Morph Supportedbox under "Animation").
If you go to "Morph Explorer" and press
Enable Manual Slider Control you will be able to manually drive the sliders, this is only a debugging tool, if you want to then see the animations drive the sliders, press
Allow animation to drive sliders.
If you know a way to correctly export shape key animations in the DMX format, feel free to edit this part, as DMX is the preferred format for S&box.
- Create your shape key animation
There needs to be at least one animation as the target for the export, this can be either an Armature or Mesh animation, in this case, we'll do a simple Armature animation that does nothing.
- Create an animation that lasts the same as your Shape Key Animation, even if it's just keyframing the location of a random bone in the first and last frame.
The image above shows 2 animations in the NonLinear Animation Editor, you don't actually have to push down any animation, it is just to show that there is an animation for Armature, one for Shape Keys, and that they last the same.
- Export in FBX format, the object types will only need to be "Armature" and "Mesh", "Apply Scalings" set to
- Import the animation in Modeldoc as a "Simple Animation".
This will be the final result:
Note the morph sliders moving because of the animation, they are not limited by 0 and 1.
This part of the guide was originally made by user Divined as its own page.
After importing your .qc into Blender, simply bring up your head along with the .vta and select both and export it as a DMX like below:
Importing the morphs into ModelDoc is the same as importing any other mesh, just import the .dmx as a new mesh and your morphs will appear on the bottom right under morph explorer. If you want to play around with them, simply enable manual slider control.