Integration: Oculus LipSync
Unity SDK / Integration Guides / Oculus LipSync
Don't forget to generate your didimos with support for Oculus LipSync animation. See Built for Oculus LipSync
In order to animate your didimo with Oculus LipSync, you will need to have the Oculus Integration package installed.
Setup
If you don't have the Oculus Integration package installed yet, you can do so now.
Install
- Add the
Oculus Integration
package to your account through Unity's Asset Store- Download and install the
Oculus Integration
package, through Unity's Package Manager. It should be listed underPackages: My Assets
. Refresh the Package Manager if required.- Follow the instructions to update Oculus and restart Unity
You may be asked to update some tools related to Oculus and restart Unity BEFORE the plugin will be installed. If you restart - check to see if the plugin still needs to be installed. A successful install will result in an
Oculus
folder in the Assets folder.
If you don't have the Oculus Module of our Unity SDK, it's recommendable to install it as well. You just need to add the Oculus folder to our SDK folder.
Preset Example Scene
There is an example scene that is already set up to work out of the box that you can explore.
Run Example
- Download and install the Unity SDK using our Quick Start Guide
- Open the OculusTestApplication scene in
Assets/Didimo/Oculus/Examples/Scenes/OculusTestApplication.unity
- Create a build for your oculus device using this scene
- Explore the scene with the didimo using LipSync
Create your own scene
You can also set up your own scene to test LipSync. There are only a few components required:
Create your Scene
- Download and install the Unity SDK using our Quick Start Guide
- Create or open a scene with a didimo in it
- Add the following Oculus components to an object on the scene:
OVRLipSyncContext
,OVRLipSyncMicInput
- Add the following Unity component:
AudioSource
- Add our script
OculusSceneLipSync
script to your didimo available in our Oculus module and map the components to the variables on the editor.
If you do not have our Oculus module installed, our OculusSceneLipSync
script won't be available, but you can create your own version of this script as well:
// LipSync Variables
public OVRLipSyncContextBase lipSyncContext;
public OVRLipSyncMicInput lipSyncMicInput;
public AudioSource lipSyncAudioSource;
// Animate the didimo
private void Update() {
OVRLipSync.Frame frame = lipSyncContext.GetCurrentPhonemeFrame();
if (frame == null) return;
for (int i = 0; i < visemeNames.Length; i++)
{
string visemeName = visemeNames[i];
float visemeWeight = frame.Visemes[i];
didimoComponents.PoseController.SetWeightForPose("oculus", visemeName, visemeWeight);
}
}
Updated about 2 years ago