Skip to content

Rokoko/rokoko-studio-live-unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rokoko Studio Live Plugin for Unity

Rokoko Studio is a powerful and intuitive software for recording, visualizing and exporting motion capture.

This plugin let's you stream animation data from Rokoko Studio into Unity to preview and work with all your motion capture data easily and intuitively.


Requirements

The minimum officially supported version of Unity is 2018.4.x LTS. Although it hasn't been tested for earlier versions, we except that all core scripts should work as we use pure C#, but not the UI functionallity.

Features

  • Live stream data:
    • Up to five actors that
    • Can all include body, face (52 blendshapes) and finger data at the same time.
  • Control Rokoko Studio from within Unity

Getting Started

Package includes 2 demo scenes

  1. RokokoPluginExampleScene is a very basic setup that re-creates the Rokoko Studio data with default actors and props. Ideal for testing out the plugin.
  2. RokokoPluginExampleScene_CustomActors is an extended demo that demonstrates the usage of custom actors and props. Please expand CustomInputs game object in hierarchy to see various different examples.

Top level scripts and settings

1. StudioManager

StudioManager script is responsible for listening and populating the scene with actors and props from the incoming Rokoko Studio data.

  • Receive Port - This is the listening port for Rokoko Studio data. It should match the selected port of the Live Stream option inside Rokoko Studio. 14043 is by default.
  • Actor and Prop Prefab - These two fields are optional and used to auto-generate Actors and Props when no overrides found.
  • UI Manager - This is an optional field for showing in UI all the available inputs coming from Rokoko Studio live data.
  • Actor and Prop Overrides - These fields are auto-generated based on the Actor and Prop overrides found in scene. This is a read only field to check the overrides during runtime
  • AutoGenerateInputsWhenNoOverridesFound - You can toggle on/off whether the StudioManager should auto-generate Actors and Props when no overrides founds.
  • ShowDefaultActorWhenNoData - This shows the default Actor Prefab in T Pose when no Rokoko Studio data is availble.

2. CommandAPI

CommandAPI script is responsible for communicating remote commands to Rokoko Studio such as StartRecording, StopRecording, Calibrate Smartsuit etc.

  • API Key - This key must match the API Key in Rokoko Studio (Menu->Settings->CommandAPI->API Key).
  • Port - This is the send port for communicating commands and should match the port in Rokoko Studio (Menu->Settings->CommandAPI->Listen Port).
  • Response Text - This is an optional field for showing the command status.
  • IP Address - This is the local IP of Rokoko Studio. If it's on the same machine, leave it as 127.0.0.1. Alternatively you can assign it to a different local network address.

Overriding Actors and Props with custom assets

1. Actor

You can import any custom character in Unity and use it as an Actor. Simply add your character into your scene and add Actor component on it.

Important Notice: Any custom character/actor must be in a T Pose, so we can retarget it properly from Smartsuit.

  • Profile Name - Update this field with the profile name of Rokoko Studio to override this actor with your custom one.
  • Bone Mapping
    • Animator - If your character is in the stardard Humanoid format you have to mark it as Humanoid in the Animation Type under the Rig tab in Unity's inspector.
    • Custom - By selecting this option a new script HumanBoneMapping is automatically added and assigned in the GameObject. From there you may assign any custom hierarchy to be driven by the Actor's data.
  • Face - Assign any Face for the given Actor. Hit Create to create a new Face component for the given model.

2. Face

Face does not override a profile directly. Instead it's controlled by an Actor

  • Blendshape Mapping
    • ARKit - Use this type if your face model is rigged according to Apple's ARKit Blendshapes
    • Custom - By selecting this option a new script BlendshapesMapping is automatically added and assigned in the GameObject. From there you may assign any custom blendshape names to be driven by the Face's data.
    • Note: You can see your model's existing blendshapes by expanding the Blendshapes menu inside the SkinnedMeshRenderer of your face model.

  • MeshRenderer - Here you assign your face model's SkinnedMeshRenderer. Hit Find in Hierarchy to auto find the mesh in model's hierarchy.
    • Note: Below SkinnedMeshRenderer you can see your model's blendshapes total count, as well as if there are any missing ones and which are they.

3. Prop

You may add any kind of 3D object in the scene and add the Prop script on it.

  • Prop Name - Update this field with the prop name of Rokoko Studio to override this prop with your custom one.
  • MeshRenderer - Here you assign your face model's SkinnedMeshRenderer

FAQ

1. Incoming data are in bad format. Please ensure you are using JSON v3 as forward data format

Make sure you are using Rokoko Studio 1.8 and above and you have selected Unity as the live forward option. Alternatively you can use custom forward data, go to its settings, expand the details dropdown and select JSON v3 as the Data Format.

2. Seem like port: xxxxx is already in use. Is plugin running already in other application?

Make sure that the plugin is not already running in another instance, or the selected binding port is not used by another application.

3. My character has wrong joint rotations

Make sure that your character is in T Pose. Please refer to Actor section.


Licence

GNU Lesser General Public License v3.0