Skip to main content
The server sends the mouth shape of every sound of the voice (15 visemes, free, in every language) and LokutorLipSync plays them on the clock of what is being heard, so the mouth stays in time through buffers, pauses and interruptions. Visemes are on by default.

Set it up

Add a LokutorLipSync node beside the LokutorAgent (or above it, under the same character) and drag the face meshes into Faces. The agent finds it by itself. Teeth and tongue meshes go there too if they have the shapes. The mouth is recognised by the names of its blend shapes. Upper and lower case do not matter, nor what an FBX exporter puts in front (Face.viseme_aa):
The agent’s own Face, Mouth Blend Shape and Jaw are shortcuts for a simple mouth: it makes the LokutorLipSync for you.

Your own names

Mapping says which of your shapes make each viseme, and how much of each:
The viseme names are Lokutor.VISEMES: sil PP FF TH DD kk CH SS nn RR aa E ih oh ou. sil is the mouth at rest and needs no shape.

A jaw, or a drawing

  • Jaw: a Node3D rotated around its local X axis. Or Skeleton and Jaw Bone for a bone. jaw_max_angle_degrees is its widest. Jaws and blend shapes can be used together.
  • Sprite: a Sprite2D, an AnimatedSprite2D or any node with a frame. Frames 0 to 3 are closed, slightly open, open and round. With other drawings, Sprite Frames gives the frame of each viseme: {"sil": 0, "PP": 1, "aa": 2, "oh": 3}.
For anything else read mouth_open (0 to 1), current (the strongest viseme) or weights (the 15 of them), or connect viseme_changed.

The feel

Several voices, one mouth

A character can have a LokutorAgent for conversation and a LokutorVoice for written lines on the same LokutorLipSync. Each voice keeps its own visemes and the mouth follows whoever is speaking; stopping one does not close the mouth of the other.

Without visemes

When a voice has none, the mouth follows its loudness (gain sets how much). To drive a mouth from audio of your own, call push_visemes() with its visemes, if it has them, and advance() every frame with how much of it has been heard:

With moods and expressions

LokutorLipSync writes only the shapes it found, so expressions on other shapes of the same mesh are yours. Mouth expressions (a smile, a frown) and visemes add up: fade yours to about a third while the character speaks. Game characters has the whole recipe, and Asset pipeline the shapes to model.