Unreal: OMS Player Configuration Example¶
Note
This is a step by step guide to setting up an OMS Player in Unreal.
For the reference documentation for the Unreal OMS Player Plugin, refer to the Unreal OMS Player Reference Documentation document.
OMS Player Configuration Example¶
HoloEdit 2021.2 comes with new, streamlined OMS Player setup in UE4.
Warning
There are specific HoloSuite player requirements when building VR-projects. Please refer to the HoloSuite Player Requirements for VR Build Support document to learn how to prepare a HoloSuite player for VR-projects.
With the HoloStream Player for Unreal successfully installed to UE4, you’re ready to create an OMS player to use in your project.
In order for Oms Players to work in standalone builds, Ue4 requires a subfolder named ‘Movies’ for all .mp4 files. Create a Movies folder in the project window and add your MP4 file(s) by clicking and dragging from your computer into the project.
Next, add your OMS and MP4 file(s) to the Content folder.
OMS Player Content in Windows Explorer
After adding your OMS and MP4 files, you’ll need to create an OMSMesh Actor in your scene. Use the search bar in the “Place Actors” tab to locate OMSMesh Actor, and click and drag an OMSMesh Actor into your scene to create a new OMSMesh Actor instance.
After creating your new OMSMesh Actor instance, you can select it in the “World Outliner” and configure it in the “Details” tab.
To configure your OMSMesh Actor to play your oms and mp4 files, you’ll need to configure your Actor. in the “OMS Settings” category in the “Details” tab, assign your oms file to the “OMS” field, and assign your mp4 file to the “Texture Source” field.
Your OMS player is almost configured, but it still needs a Mesh Material before it will play. The Mesh Material requires nodes to drive the oms playback, along with any custom shading you need for your project.
You can generate a new Mesh Material by right clicking on your OMS object, and choosing Create Unlit Material.
Now that you’ve created a material, you can assign it to the Mesh Material field.
Save and compile changes to complete your configuration.
To preview the OMS playback select ‘Play’ from the Viewport toolbar.
Adding Head Retargeting¶
To add head retargeting data to your OMS Player, first configure a standard OMS Player as described above and ensure it’s playing correctly in the viewport.
Next, ensure that Retargeting Enable is selected in your OMS_Mesh_Blueprint’s Details panel, then follow the steps below.
Adding skeletal mesh and bones:¶
OMS playback with head retargeting requires a skinned mesh and skeleton data to control your actor’s motions. These can be generated from an OMS file containing embedded rigging data.
To generate a new SkeletalMesh, right click on your OMS file and select “Create Retarget SkeletalMesh”.
Next, right-click on the newly created SkeletalMesh and under Skeleton, click Create Skeleton.
You should rename these appropriately, as both the mesh and skeleton assets require specific configurations.
Retargeting Blueprint:¶
Adding an Animation Blueprint is what enables head retargeting to lock onto a target object and control your actor’s head motion during playback.
For example, you can add a Look At blueprint using the following steps:
In your OMS_Player folder, right-click to create a new asset, and select the Animation Blueprint from the Animation dropdown menu. Animation Blueprints must be provided a target skeleton. Select the skeleton you generated in the previous steps and press the “ok” button.
Open your Animation Blueprint to expose the AnimGraph window.
In the AnimGraph, you will see an empty Output Pose node.
First, Create a Look At node and connect its output to the Result of the Output Pose. With the Look At node selected, update its Details as follows:
Update its Bone to Modify to ‘head’
Expand the Look At Axis category, and set the Look at Axis values to 0.0, 0.0, 1.0
Next, Compile and Save the Animation Blueprint.
After Compiling the Animation Blueprint, you can drag it into a level containing your OmsMeshActor.
If you’ve transformed your OMS Player actor in any way, ensure that your animation blueprint Actor has the exact same rotation, scale, and position as your OMS player Actor.
Adding a look at object¶
In order to get a useful result, you’ll also need a target for your ‘Look At’ script to point the head towards.
Place a new object in the scene. For example, a primitive such as a sphere.
In the Animation Blueprint, select the Look At node and in its Details panel, check the “Expose” checkbox next to the Look At Location setting in the Target tab.
This will expose the Look At Location pin in the AnimGraph.
Next, add a variable to use as the look at location, and in the Details tab set its variable type to Vector.
Drag your new Vector variable into the AnimGraph as a Get node and connect it to the Look At Location input of the Look At node.
Next, switch over to the Event Graph of the Animation Blueprint. Add the following assets and connections between the nodes:
Pull from the “Event Blueprint Update Animation” exec pin and Create a Get All Actors with Tag function; in the node’s Tag field, specify any name for a tag. For this example, use “LookAtTarget”.
Click on the Get All Actors with Tag Out Actors output and create a Get (a ref) node.
Click on the Get node’s output pin and create a GetActorLocation node
Drag out from the GetActorLocation node’s Return pin and create a Set node for your vector variable.
Connect the Get All Actors with Tag node’s Exec output to the Set node’s Exec input.
Compile and Save your Animation Blueprint
In the viewport, select the primitive ‘look at’ object that you added to your scene.
In the object’s Details panel, navigate down to the Actor tab and add a Tag element. In the new field that is created below, add the ‘LookAtTarget’ tag that you entered in the Get All Actors with Tag node.
You can hide your skeletal mesh in the viewport by assigning a custom material to it. In your OMS_Player folder, create a new material. Open the material, set the blending mode in its Details panel to Translucent, create a Constant node in the material editor, and connect it to the material’s Opacity channel. Back in your OMS_Player folder, open your skeletal mesh object and assign the translucent material to the skeletal mesh’s Material Slot.