Animation Player

Our animation player plays Didimo Animations, which can be imported from JSON files. The next sections describe the format used in these files and how you can import your own animations.

Approach

Our MOCAP recordings store the FACS in JSON format as examplified below, and then converted into a Unity asset called Didimo Animation. You can explore the sample MOCAP JSON located at:

Resources > DidimoImporter > 2.0 > AnimationFiles > faceROM.json

For example:

{
  "ctrl_m_FACS_001": {
    "nasolabialLeft": [
      -0.0022658680099993944,
      -0.0022658680099993944,
      -0.0019228083547204733,
      -0.0019228084711357951,
      -0.0019228083547204733,
      -0.001922808587551117,
      -0.001922808587551117,
      ...

    "rightCornerup3": [
      -0.0019235251238569617,
      -0.0019235251238569617,
      -0.0019228084711357951,
      -0.0019228084711357951,
      -0.0019228084711357951,
      -0.0019228084711357951,
      -0.0019228084711357951,
      -0.0019228084711357951,
      -0.0019228083547204733,
      -0.0019228084711357951,
      -0.0019228083547204733,
      ...

  }
}

We then use the Import Animation tool, on the Editor Menu, to convert data from the JSON file into a Didimo Animation asset that can be used by the animation player.

  1. Open the Animation Importer Window

    Window > Didimo > Import Animation
    
  2. Click on the Load animation button to pick a file to be imported.

    alt text

  3. After successful import, you will see a single track with the whole duration of the recording.

    alt text

  4. You can extract any number of animations by defining the starting and ending frame for each animation, as shown in the image below.

    alt text

  5. Click on "Save all" to save these new assets. A Didimo Animation asset is created for each track defined in the previous step.

Animation Files

The next image shows the Didimo Animation files included in the package.

alt text

Poses

The Didimo Animations located in the Expressions folder have a single frame that express basic facial emotions: neutrality, happiness, sadness, anger, surprise, disgust, and fear.

MOCAP recordings

The Didimo Animations located in the DefaultMocap folder are sample animations that showcase the range of motion of different rigs (basic rig from the trial tier level vs. full rig from a premium tier level).

Automatic Setup Of The Animation Player

The instantiation tool will handle all the setup of the animation player and the corresponding realtime rig. We also include a sample Animation Manager to help set up a fully working user interface. You can learn more on this topic by exploring the sample scene, and how to use our scripts for connecting to the Didimo API, instantiate didimos, and play animations.

Go to Exploring the sample scenes


Didimo animations demo scene

The realtime rig supports two types of animations which you can explore in finer detail in the animations demo scene. There you will be able to play an animation from a sample animation file, play through all the blendshapes and FACS, or change blendshapes manually to change the facial expression of a didimo. Please open:

Scenes > DidimoAnimationDemo

First, you will need to add a didimo to the scene. You can drag one prefab from the assets folder if you have already imported a didimo into the project assets. There are a number of options to import a didimo. Please read the documentation to learn how to import a didimo using the Didimo Browser

You will need to add an animation track to the didimo component. If can find one in the folder next to the sample scene. Assign the animation track to animation player component attached to the didimo and update the autoplay index as shown in the image below.

alt text

Then, you need to drag the didimo onto the animation component under the Scripts game object on the scene hierarchy.

alt text

You are now ready to run the scene. This sample scene provides four ways to play/control an animation:

  • Play the didimo animation
  • Iterate through the FACS
  • Iterate through the blendshapes
  • Manually adjust blendshapes values to make a distinctive pose

alt text


Last updated on 2020-10-06