Skip to content

BennyKok/mocap4face-unity

Repository files navigation

mocap4face-unity

This is an unofficial Unity integration for mocap4face by Alter (Facemoji).

Repository Setup

Option 1: Package Manager

It is suggested to use the Unity Package Manager to add this repository to your project, with the following URL:
git+https://github.com/BennyKok/mocap4face-unity.git

In order for this to work, first install Git LFS and enable it in the Unity Package Manager.

Screenshot of Unity -> Window menu -> Package Manager Screenshot of Plus (+) button -> Add package from Git URL Screenshot of pasting in URL and Add button

Option 2: Submodule

Alternatively, clone this repository as a submodule in your project's Packages directory:
git submodule add https://github.com/BennyKok/mocap4face-unity.git Packages/mocap4face-unity

This option is not recommended if you are working in a team or intend to redistribute the code, since most of the Packages/ directory is meant to be excluded from version control.

Per-Platform Setup

Android

  • This package uses External Dependency Manager for Unity, please set it up first.
  • Download the mocap4face Android AAR library from the Facemoji developer portal.
  • After downloading, copy mocap4face-x.x.x-SNAPSHOT.aar into the Assets/Plugins/Android/Library directory in your project.
    • If any directory does not exist, create it.
  • If you encoutered an error about a duplicated Kotlin library, enable these options in the Publishing section of Player Settings. Then in the Unity menu bar, choose Assets > External Dependency Manager > Android Resolver > Force Resolve.

Screenshot of Android Build Settings

iOS

  • Download the mocap4face iOS framework from the Facemoji developer portal.
  • After downloading, copy the contents of Mocap4Face.xcframework/ios-arm64 into the Assets/Plugins/iOS/Library directory in your project.
    • If any directory does not exist, create it.

Expected Result

Android and iOS

Before running the demo scene on your device, put in the API key in the inspector.

Screenshot of API key location

Then you will see the blendshapes view as below.

Development

Please chime in the Alter Discord for further discussion if you would like to help out with this Unity integration!

You can find the Discord link in the page here -> mocap4face GitHub Page.

Credit