Optitrack live mocap streaming to Unreal

I’m using Unreal 4.20.3 with the Motive 2.1.1 and Unreal Engine plugin 1.2. (actually, I’m using Unreal 4.19 and the 4.19 plugin – make sure plugin and Unreal version match up.)
Later Unreal won’t work currently (Jan 2019)

Make sure you can ping the other computer if you are having problems with network discovery see here

SETTING UP MOTIVE TO STREAM DATA::
– this can be either a prerecorded file, a live performer or a VR user

Note the name of the skeleton you want to stream e.g Ruth

Heres my streaming settings: (seems to hate it if Transmission type is Multicast.)

Motive Streaming Settings

Make sure the Asset Settings are like so: Bones on, Segments off.

Asset Properties

::SETTING UP UNREAL to RECEIVE DATA

Add the Optitrack plugin to the Unreal engine – put it in the plugins directory where the engine is installed.

In Unreal Enable the plugins = Optitrack NatNet and Optitrack- OculusVR. Disable all the other Vr plugins eg Oculus Steam etc.

Import your character mesh and set up like the tute…

Drop an Optitrack Client Origin into the level – this will be the zero point of everything.

Select it in and under Optitrack set the server and client e.g 127.1.0.0.1 if it’s testing on the motive local machine, or automatic if its on 2 different machines.

Set streaming to Unicast if using Wifi

Set the HMD RigidBody Id to the Id of the HMD from Motive and the orientation to +X .

here are my settings – like I said local loopback so the server is Multicast if I was streaming to another computer then use Unicast.

SET UP THE CHARACTER::

In Motionbuilder make sure that your character mesh is not parented to a bone in the hierarchy – unparent it – otherwise, the Optitrack Unreal plugin hates it and crashes.

My mesh (blue nodes) is NOT parented to the skeleton (white nodes)

I’ve been exporting a tpose take of my performer and using a zeroed out version of the skeleton, as the start and editing my character to fit the size of the skeleton as the unreal plugin only gets bone translations, it won’t do retargeting so if the characters are different sizes to performers, there may be a problem.

Select the imported character and Create an Animation Blueprint, choose OptitrackAnimInstance and then <YourSkeleton>

 

Set up the Animation blueprint by adding these special Optitrack nodes. Then save it.

Select the Optitrack Skeleton node In the details panel hit Auto Fill Bone Mapping – in the list check and possible set correct bone names.

Recompile and Save.

Drop the Anim BP character into the level then under Details Add component, OptitrackSkeleton and set the  Source Skeleton name to your skeleton (that’s gonna stream) in Motive and set the Streaming Client Origin to the  Optitrack Client Origin.

in the 3d window, Show /Developer / Bones may be helpful here. . . . . . . .

(I’ve been having a crash where Unreal borks – the seeming fix is the startup order. So Stop Motive playing, Play Unreal, Play Motive)

and in the OptitrackClient Origin / Details there is a setting for DrawDebug Skeleton– you can see here if the mocap is coming in – you see a skel if your character won’t move. Mine took a bit of clicking and recompiling to get it moving.

White Skel is the Optitrack mocap data streaming in. Red Skel is my character

something wrong here… so this is in the Mesh import SettingsForce Front X-Axis

Now it’s fixed like this – you can’t see the white skel of the Optitrack data as it’s hidden by the character skel :

Official Tute here:

https://v21.wiki.optitrack.com/index.php?title=Unreal_Engine_Skeleton_Streaming