Download the baseball bat model from Blendswap.com:
Note, Blender is optional, most 3D manipulation software should be able to export as .fbx and works equally well.
In the next part we will simply download the model and open it in Blender, from there we can export a new .fbx to use for the game model. First before exporting the .fbx we will need to clear any rotation and clear any scale so the model's scale is 1:1 and centered on the origin.
๐Important. The model is not at the origin and is rotated slightly off axis. For perfect alignment it is critical that the rotation and location and scale must all be cleared, and applied before exporting the .fbx so the exported model is guaranteed to be located at the origin and the model's scale will be 1:1 in all applications.
๐Important. For this tutorial the bat model was arbitrarily scaled to exactly 1 meter. If you have a physical prop (eg. toolbox with tracker attached) make sure to scale the toolbox model to be the exact same dimensions (in meters) as the real/physical item.
If the tracker was attached to a real baseball bat then I could measure the exact dimensions, eg. If the IRL bat and live link bat model are identical dimension and tracker alignment is precise the motion capture would appear realistic with mass and inertia and real collisions !
๐Properly aligned tracker/model won't clip through the floor when set down or dropped!
๐Important. Unity editor 2019.4.40f1 is the recommended version to use when building mocap assets for Mocap Fusion.
๐Important. After the Unity project loads make sure you have imported the latest APS_SDK by dragging and dropping the APS_SDK.unitypackage to the viewport.
Download the latest APS_SDK from the APS Discord or the Props Tutorial and import it into the Unity project.
In the APS_SDK look for the TrackerPointTarget prefab you can add to props to specify a fixed tracker offsets so the prop will snap to the fixed offset whenever attached to a tracker.
๐Important. The end of the video shows the Tracker Serial number field. This is needed so the prop will automatically attach to the correct tracker and will always use that tracker.
Assign the Tracker Serial of the tracker attached to the physical prop. Check APS trackers setup panel to find the properly formatted serial name of the tracker, copy that value exactly and include all characters and capitalization.
After rebuilding the prop a new folder should appear, copy the prop$baseball-bat prop to the VR_MocapAssets folder
The mocap prop should now be available in the game. Before we can use it with live-link we also need to add the .fbx to a UE live link Blueprint.
Download the APS Live Link plugin from the FAB.
The Live-Link Pluginย Setup Tutorial
๐Important. In the latest APS update Virtual Trackers has slightly changed. Now whenever a tracker is connected to a VR prop the live-link server sends the prop's origin coordinates instead of the tracker's origin. This makes it intuitive when creating the prop Blueprints as there is no need to offset the model or worry about pivot points, simply add the model at the Blueprint's origin.
๐Important. For virtual trackers to function you must assign the correct Tracker ID for the Blueprint and is shown in the video. These are the nodes responsible for live-link location:
Look for the TrackerObject Blueprint included with the APS live-link plugin. This allows syncing with the Vive trackers in APS and includes a simple node setup in the Event graph. Or duplicate the TrackerObject blueprint and use it with a custom model!
The fbx is now imported into the UE project and has been added to a tracked blueprint. The Blueprint has been added to the scene with the APSCore and is ready for live link!
๐Important. Make sure the firewall settings are not blocking either UnrealEditor or MocapFusion.
๐Important. Ensure that "Run In Background" is enabled in both applications so both windows will run at full framerate.
If the TrackerObject is configured it should track with the Vive tracker in VR, but also note that when adding the bat prop in VR it automatically linked to the tracker immediately after being added, this is because we assigned a serial number which matched the tracker - without any need for user alignment - and makes it simple to add tracked props ready for mocap instantly!
Take special note of how the TrackerObject in UE location changed to the prop pivot the instant the bat prop was added in VR, because the prop we built earlier includes a TrackerPointTarget -ย live-link detects this component and then sends the prop's origin rather than the tracker's origin.
Making it simple to create Blueprints for props.
I hope you found this tutorial helpful.ย
And I hope you enjoy using the live link plugin!