Use the Expression Function

Updated: 09/04/2019

This page describes the procedure for playing back facial expressions on Cubism models using Expression.
The following explanation is based on the assumption that the project is the same as the project for which the “Import SDK,” “UpdateController Settings,” and “Save/Restore the Values to Be Manipulated” are performed.

Summary

To play back facial expressions in the Live2D Cubism SDK for Unity using .exp3.json, use the “Expression” component.

If the model was imported with “Live2D/Cubism/OriginalWorkflow/Should Import As Original Workflow” checked in the Unity Editor menu, the Prefab generated will be set to Expression.

To set Expression on a Prefab that is not generated using the OW method, perform the following three steps.

  1. Attach CubismExpressionController
  2. Set “[modelName].expressionList”
  3. Set the facial expression to be played

1. Attach CubismExpressionController

Attach “CubismExpressionController” to the GameObject that will be the root of the model.

CubismExpressionController has two setting items.

  • Expression List: Set “modelName.expressionList” * Details are explained in Step 2
  • Current Expression Index: Set the index of the expression to be played back * Details are explained in Step 3

2. Set “modelName.expressionList”

Select the model and drag and drop “[modelName].expressionList” from the Inspector View into the “Expression List” of the CubismExpressionController.

Note: “[modelName].expressionList” is a list of “.exp3” assets.
Note: The “.exp” asset is the asset where Expression data is stored. The “.exp3.json” is automatically generated when imported.

3. Set the Facial Expression to Be Played

Set the index of the expression to be played in “Current Expression Index” in CubismExpressionController. In this example, set it to 0.

This completes the setup for playback of facial expressions using the exp3 asset generated from exp3.json.

When the Scene is executed in this state, the expression number 0 in “[modelName].expressionList” will be played.
By resetting the “Current Expression Index,” you can switch the expression to be played back.

Note: If an index other than “[modelName].expressionList” is set, the default expression will be played.

Was this article helpful?
YesNo
Please let us know what you think about this article.