FBX import of facial animation

CryENGINE 3.5 and up only

The feature described on this page is not available in CryENGINE versions prior to 3.5

Overview

The Facial Editor can import FBX files and extract the animation of blendshapes (morphs) into a sequence. The imported data can be loaded into a new sequence, or merged with an existing one.

This enables the animation of morph curves in Max or external facial capturing software such as FaceShift.

Importing FBX files

At the time of writing, the FBX importer uses the FBX SDK 2013.3, which can import binary and ASCII FBX files from 2009 to 2013.
To import an FBX file, choose "Import FBX Animation to Sequence" from the "Sequence" menu.

In case the FBX file contains several meshes a dialog window will pop up. Select the mesh to import the animation from. Animation can only be imported from a single mesh. But the import can be repeated several times and the imported data can be merged into the existing sequence.

If there are several animations inside the FBX, you will also need to choose which take you want to import.

After the import is complete the converted data will either be placed into an entirely new sequence, or merged with the current sequence.

All data is imported into a group subfolder containing the name of the mesh and the scene name it was imported from. (Some files don't contain scene or mesh names, in which case the folder will be called FBX_Import_)

If importing several FBX files and merging them into the same sequence, you might need to rename the group folder after import, so that the new animation is not placed into the same folder as the old one.

Trouble Shooting

  • BlendshapeChannels in FBX can in theory control more than one target shape (though it is uncommon).
    This is not supported by the Facial Editor FBX importer. One morph per channel only. The first target shape will be evaluated only.
  • The blendshapes have to match the existing effectors/expressions of the character currently loaded, there is no automatic internal remapping functionality.
    Either export the animations to match the expressions in the character's facial library, or create new expressions to match the profile.
    shapes that have keyframes, but all keys have a value of 0 are filtered out as an optimization
  • At this time, importing of different tangent/interpolation types is not supported and this is not on the roadmap either.
    Use additional keys to achieve the desired effect, or select the keys in Facial Editor and set the tangents on them manually.
  • Skeletal animation can not be imported. However, if neck and head bending can be exported as a fake "virtual" blendshape, the facial editor can use bone expressions to import and play them.
  • Only animation from layer one will be imported. In case the selected animation is on several layers, a warning message will pop up. The import will still be executed, but might be missing data.
    Bake your animations into a single layer before exporting.

Notes

  • Negative animation values are supported. In Max, turn of the limits in the Morpher, or change the range from 0..100 to -100..100 to animate this way
  • Key Values inside the FBX file are expected to be in percent. For example 100 means fully blended in.
  • During conversion the Facial Editor creates a temporary FSQ file. This can be saved out to Animations/temp, called Converted_FBX_temp.fsq
    This file serves just for trouble shooting purposes. Enable this by setting the CVar fe_fbx_savetempfile to 1. By default, it is set to 0.

Animation in Max

Think Expressions, Not Morphs!

Morphs can now be animated in Max - or other animation packages. The head used for animating does not need to be the same one as the animation will be used for in CryEngine. Only the names of the morph targets count.

Since the Facial Editor works with expressions instead of morph targets directly, and Facial Expression library can be set up to support the imported animation. Even characters with a bone based facial setup can play the FSQs, if they have expressions with matching names set up.

This means you can create "virtual" morphs on your character, animate them, and then create a facial expression in Facial Editor out of existing morphs with the same name. This is also useful when transferring Motion Capture data this way (see below).

When exporting, simply select the head mesh and choose "Export Selected" from the File menu. Export as an FBX with the standard "Media and Entertainment" settings.

Try always using "Export Selected", to avoid having the entire scene exported. This reduces file size, increases loading time, and you don't have to manually select the correct mesh from the file upon importing.

Morph Limits in Max

The Facial Editor supports morphs with negative influences. This can be utilized to achieve inverse effects, for example playing a "blow cheeks" with a negative value can make the cheeks look fallen inwards. An upside down "Frown" is a smile and so on.

By default Max limits Morphs to be animated from 0..100, but this setting can be changed in the parameters of the Morpher modifier, in the "Global Parameters" tab.

Curves and Tangents

All imported animation curves will be given zero'ed tangents, which is the default in Max as well. At this time, importing of different tangent/interpolation types is not supported and this is not on the roadmap either.

In terms of animation, this means you shouldn't play with the tangents in the curve editor of Max, as this will not be transferred to CryENGINE. Use additional keys to achieve the desired effect, or select the keys in Facial Editor and set the tangents on them manually.

Below is a picture comparison of an animation created in Max and then exported and imported via FBX into the Facial Editor.




Curves in 3ds Max



Curves in CryENGINE Facial Editor
The curves are almost identical

Facial Motion Capture

FBX import opens the door for some facial capture software. Any software able to export blendshape animations (not marker data, or bone animation, but expression values) can be used to directly import animation into Facial Editor.

Other Facial Motion Capture software can be used by loading and mapping it in Max first, and then exporting FBX from there.

Here is an example of FaceShift, a software using a single Microsoft Kinect as a capture device. The data is imported directly from FaceShift into CryENGINE via FBX, without going through Max.