S&box Wiki

Morphs

We will be using "Blender" as it is the most widely used free modelling program, but the guide mostly applies to every other program.

FBX file format

Exporting the mesh

  1. Create the shape keys
1.jpg
Avoid using underscores _ in Shape key names, as they're used for Corrective Shape Keys; Further reading can be found in this page.
  1. Export in FBX format, making sure to include the mesh and armature.
image.png
The model will need at least one bone, even if it's a static prop, because Morphs are animation driven and Animations need bones.
Reset all Shape Keys to 0 before export, as they will be applied, and change the default mesh if you do.

Adding the morphs in ModelDoc

Morphs are animation-driven, even if morphs appear when importing the model, you won't be able to use them until there's at least 1 animation.

  1. Import the Mesh in ModelDoc

  2. Add any animation, use the model itself if it doesn't have/use any.

  3. Add a material that supports morphs (in "Material Editor" check the Morph Supported box 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.

3.jpg

Exporting Morph Animations in Blender

The animations are stored in the mesh, this guide will not go over how to create them, as it is commonly used and already widely covered.

  1. Create your shape key animation

  2. Export in FBX format, making sure to include the mesh and armature.

  3. 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.

DMX file format

You will need the "Source Export Tools" plug-in.

Exporting the mesh

  1. Same as FBX

  2. Go to "Scene Properties" and then "Source Engine Export", change "Export Format" to "DMX"

  3. Use the latest DMX version, as of writing this it's "Binary 9" and "Model 22"

  4. Select the checked "MeshName.dmx" under "Source Engine Exportables" (in my case "citizen.dmx", check if unchecked)

  5. Go to "Flex Properties" and press Generate Controllers

  6. Press Export to export the model.

2.jpg

Legacy Source 1 Morphs

This part of the guide was originally made by user Divined as its own page.

Exporting the morphs

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:

Flexes

You are going to need the Blender Source Tools for this to work, or any other software where you can import your .vta and .smd and export as .dmx

Importing morphs in ModelDoc

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.