Drive the MetaHuman Rig Using Viseme Data
This section explains how to import CriLipsMake2's Mpeg4-Visemes Animation Curve File (.csv) as a CurveTable asset and drive the MetaHuman rig by specifying visemes.
(cri/tools/CRILipSyncAlive/samples/MetahumanSample)
Importing as a CurveTable Asset
This method allows you to import the CSV file output by CriLipsMake2 as a CurveTable asset in Unreal Engine.
First, convert the CSV into a format that Unreal Engine can import.
"""Convert the CSV output by CriLipsMake2 into a format that a UE CurveTable can read.
Usage: python to_curvetable.py csv/A01.csv [output.csv]
"""
import csv
import sys
from pathlib import Path
# Elements to output to the CurveTable
ENABLE_ROWS = ["time","PP","FF","TH","DD","kk","CH","SS","nn","RR","aa","E","ih","oh","ou"]
def main():
if len(sys.argv) < 2:
sys.exit("usage: python to_curvetable.py <input.csv> [output.csv]")
src = Path(sys.argv[1])
dst = Path(sys.argv[2]) if len(sys.argv) > 2 else src.with_name(src.stem + "_curve.csv")
with src.open(newline="", encoding="utf-8") as f:
rows = [r for r in csv.reader(f) if r]
transposed = [list(col) for col in zip(*rows)]
by_name = {row[0]: row for row in transposed}
transposed = [by_name[name] for name in ENABLE_ROWS]
transposed[0][0] = "---" # Represents time
with dst.open("w", newline="", encoding="utf-8") as f:
csv.writer(f).writerows(transposed)
if __name__ == "__main__":
main()
---,0.0000,0.0100,0.0200,0.0300,0.0400,0.0500,0.0600,0.0700,0.0800,0.0900,0.1000,0.1100,0.1200,...
PP,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
FF,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
TH,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
DD,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
kk,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
CH,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
SS,0.0000,0.0000,0.0000,0.0000,0.0111,0.0329,0.0645,0.1047,0.1519,0.2043,0.2597,0.3159,0.3706,...
nn,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
RR,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
aa,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
E,0.3159,0.3706,0.4222,0.4695,0.4998,0.5127,0.5079,0.4860,0.4481,0.3957,0.3403,0.2841,0.2294,...
ih,0.0000,0.0000,0.0000,0.0000,0.0000,0.0012,0.0049,0.0121,0.0237,0.0406,0.0633,0.0921,0.1272,...
oh,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
ou,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,...
Import the CSV file converted in this way into Unreal Engine as a CurveTable. Setting the curve interpolation to Linear or similar gives a steady appearance even at frame boundaries.

Building the Assets to Drive the Rig
Follow the steps below to build the assets for driving the rig at runtime by specifying visemes.
- Create a level sequence and key the facial expression for each viseme on a separate frame
- Bake the level sequence into an animation sequence
- Create a pose asset from the animation sequence
- Create an Animation Blueprint, and drive each pose of the pose asset with viseme data according to the sound being played
- Configure the MetaHuman to use the created Animation Blueprint
Adding a MetaHuman to the Level Sequence
Select the MetaHuman placed in the level.
Controlling the Facial Rig for Each Viseme
Viseme templates are provided as the Facial Pose Library.
For each frame of the level sequence, apply the template that matches the viseme to control the facial rig, and key the resulting pose.
For example, map visemes to templates as follows:
| Frame number | Viseme | Facial Pose Library |
|---|---|---|
| 0 | sil | 00_Neutral |
| 1 | PP | 22_MBP |
| 2 | FF | 20_FV |
| 3 | TH | 24_Tongue_Th |
| 4 | DD | 01_TDS-Ah- |
| 5 | kk | 13_KGY_TDS |
| 6 | CH | 14_ChJjSh |
| 7 | SS | 02_TDS_KGY-Ee- |
| 8 | nn | 13_KGY_TDS |
| 9 | RR | 17_Rr |
| 10 | aa | 07_Aa |
| 11 | E | 03_Ee * 0.5 + 07_Aa * 0.5 |
| 12 | ih | 04_Ih |
| 13 | oh | 09_Oh |
| 14 | ou | 11_Oo |
This frame order is also used when naming the poses in the later step "Creating a Pose Asset".
Method without the Facial Pose Library
Adjust each parameter of the facial rig to create the facial expression of the target viseme.
Example: TH Expressed with mouth opening, lip stretching, and tongue position.
Example: aa Expressed with mouth opening and lip stretching.
Baking the Animation Sequence
Select "Bake Animation Sequence" from the right-click menu of the Face track to output the rig movements set in Sequencer as an animation sequence.
Disable "Export Transforms" and bake.
The animation sequence is created in the specified folder.
Creating a Pose Asset
Select "Create PoseAsset" from the right-click menu of the animation sequence.
This extracts the poses from each frame of the animation sequence.
To use the viseme names as pose names, add the viseme names to the OPTIONAL field from top to bottom, in the same order as the visemes registered on each frame of the level sequence.
sil
PP
FF
TH
DD
kk
CH
SS
nn
RR
aa
E
ih
oh
ou
The pose asset is created in the same folder as the animation sequence.
Implementing the Animation Blueprint
An Animation Blueprint can be selected when creating a Blueprint Class.
When the skeleton replacement dialog appears for the first time, select the appropriate skeleton asset.
In the Event Graph, implement the processing that obtains viseme data according to the playback time of the sound being played.
In the Anim Graph, implement the processing that applies animation curves from the viseme data to the pose asset.
Configuring the MetaHuman
Change the settings to use an Animation Blueprint, and change the Animation Blueprint to be referenced.