Difference between revisions of "Unreal Engine: OptiTrack Live Link Plugin"

Line 9: Line 9:
====1. [Motive] Setup rigid body streaming in Motive.====
====1. [Motive] Setup rigid body streaming in Motive.====
<div class="padded">
<div class="padded">
Get Motive streaming with at least one rigid body. Make sure the [[Data Streaming|Streaming]] settings are set up correctly, and the rigid body is active under the [[Assets pane]].
Get Motive streaming with at least one rigid body. Make sure the [[Data Streaming|Streaming]] settings are configured correctly, and the rigid body is active under the [[Assets pane]].

Revision as of 19:15, 11 November 2020


Note: Contents in this page are still preliminary and the instructions are subject to be changed


This page provides instructions on how to use OptiTrack UE LiveLink plugin.

Plugin Setup

1. [Motive] Setup rigid body streaming in Motive.

Get Motive streaming with at least one rigid body. Make sure the Streaming settings are configured correctly, and the rigid body is active under the Assets pane.

2. [UE] Install the OptiTrack plugins in Unreal Engine (UE).

You can install the OptiTrack - NatNet Streaming Client plugin by putting the plugin files into one of the following directories:

  • A global engine plugin can be placed in C:\Program Files\Epic Games\[Engine Version]\Engine\Plugins
  • A project-specific plugin can be placed in [Project Directory]\Plugins

3. [UE] Enable the plugins in UE project.

Go to Edit → Plugins and enable two of the required plugins. First one is the OptiTrack - Live Link plugin under Installed group, and the second one is the built-in Live Link plugin under Built-In group.

OptiTrack - Live Link plugin. Make sure the plugins are placed in the plugins folder either in the project or engine directory.
Built-In Live Link plugin.

4. [UE] Open the LiveLink pane

Open the LiveLink pane from Window → Live Link in the toolbar.

    LiveLine pane in UE.
    LiveLine pane in UE.

5. [UE] Configure and create a new OptiTrack source

In the LiveLink pane under Source options, go to the OptiTrack Source menu and configure the proper connection settings and click Create. Please make sure to use matching network settings configured from the Streaming pane in Motive.

Creating OptiTrack source with client streaming settings.

6. [UE] Check the Connection.

If the streaming settings are correct and the connection to Motive server is successful, the plugin will list out all of the detected rigid bodies, and they should have green dots next to them indicating that the corresponding rigid body has been created and is receiving data. If the dots are yellow, it means that the client has stopped receiving data. Check if Motive is still tracking or if there is any connection error.

Connected to the rigid body data stream.

Using the Plugin

Moving Static Mesh or Camera Actors

1. Add a camera object, or a static mesh object, that you wish to move

Add a camera actor from the Place Actors pane or a static mesh from the project into your scene. For the static meshes, make sure their Mobility setting is set to Movable under the Transform properties.

    LiveLink Camera CameraObject.png
    LiveLink Camera CubeObject.png

2. Add LiveLinkController Component

Select an actor you want to animate, click the “Add Component” button on the details pane, and add Live Link Controller.

LiveLink Camera AddLiveLinkController.png

3. Select the target rigid body under the Live Link component properties

LiveLink Camera ConfigLiveLinkController.png

4. Check

Once the target rigid body is selected, each objects with the Live Link Controller component attached and configured will be animated in the scene.

Live Link Timecode Setup

When the camera system is synchronized to another master sync device and a timecode signal is feeding into eSync, then the received timecode can be used in UE project through the plugin.

1. Set Timecode Provider under project settings

From Edit → Project Settings, search timecode and under Engine - General settings, you should fine settings for the timecode. Here, set the the Timecode Provider to LiveLinkTimeCodeProvider.

LiveLink Timecode1.png

2. Set OptiTrack source in the Live Link pane as the Timecode Provider

Open the Live Link pane, and select the OptiTrack subject that we created when first setting up the plugin connection. Then, under its properties, check the Timecode Provider box.

LiveLink Timecode2.png

3. Check

The timecode from Motive should now be seen in the Take Recorder pane.

LiveLink Timecode 7.png

Standalone Game

When playing the project in a standalone game, it will require additional setup to properly receive the streamed data into standalone game mode.

Streaming Setup

1) Make sure the Live Link plugin is set up as usual.

Make sure the plugin is connected to Motive and the actors have the Live Link controller component attached. Here, we have a cube static mesh actor that is set up with the Live Link Controller component:

Project with the Live Link plugin configured.

2) Place OptiTrack Live Link Source Controller

In the Place Actors panel, search for OptiTrack Live Link Source Creator and place the actor into the 3D scene.

LiveLink Standalone2.png

3) Check Streaming Settings under the OptiTrack Live Link Source Controller

Then, make sure the streaming settings under the OptiTrack Live Link Source Creator is configured correctly to match the streaming server/client IP addresses.

LiveLink Standalone3.png

4) Check

If all the configuration is correct, the actors will be animated in the newly opened game window when playing the project in the standalone game mode.

LiveLink Standalone4.png

Configuring and Applying Live Link Plugin Settings

When in standalone game mode, the settings in the Live Link plugin may not get applied. To apply the configuration (e.g. Streamed Data Offset), we will need to create a Live Link preset from the existing settings, and specify the preset in the project settings, as shown in below screenshots. Once the preset is properly saved and loaded, the corresponding tracking settings will be reflected into the standalone game window.

  • Creating a preset from Live Link panel. Select Save As Preset
  • Assigning the preset in the Project Settings.