Setting Up the Virtual Hand Meshes

Setting up Virtual Hand Meshes involves two key steps:

  1. Importing the virtual hand meshes into your project.
  2. Configuring the virtual hand settings.

In this section we focus on the first part. For detailed information on step two, please visit the Virtual Hand configuration section.

Compatible Virtual Hand Meshes

The SenseGlove Unreal Engine Plugin is compatible with any virtual hand mesh that adheres to the Epic rig and bone structure. Additionally, the virtual hand meshes must be exported with specific settings to meet all requirements. If you're planning to model and rig your own virtual hand meshes, the Epic FBX Skeletal Mesh Pipeline is a useful starting point.

However, if you're looking to get up and running with the SenseGlove Unreal Engine Plugin quickly, the process is much simpler. Unreal Engine has included two sets of compatible virtual hand models with the Unreal Engine VR Template since version 5.1. This guide will walk you through how to export these virtual hand models from the VR Template and import them into your VR simulation.

caution

While it is possible to migrate the virtual hand meshes directly from the Content Browser of the VR Template, this approach is not recommended. As part of the setup process, it is necessary to configure the SenseGlove Grab and Touch sockets. Although it's possible to set up these sockets manually, as demonstrated in one of our older tutorials, we no longer recommend doing so. Since version v2.1.0 of the SenseGlove Unreal Engine Plugin, we’ve included a tool that automates the socket setup with a single click, eliminating the need for the tedious manual process.

Unfortunately, the SenseGlove Sockets Editor tool does not support skeletal meshes that share their skeleton. This is the case with the hand models included in the VR Template. Because of this limitation, we will be reimporting the virtual hand meshes with separate skeletons to ensure full compatibility with the SenseGlove Sockets Editor.

Exporting the Virtual Hand Meshes from the VRTemplate

  1. Start by creating a new Unreal Engine project using the VR Template. In the Unreal Project Browser, select GAMES > Virtual Reality.

Exporting the Virtual Hand Meshes from the VRTemplate - Creating a new VRTemplate project

  1. Once the Unreal Editor opens with your new project, navigate to the Content Browser. Go to All > Content > Characters > MannequinsXR > Meshes. Here, you'll find two sets of virtual hand meshes: SDKM_MannyXR_left and SDKM_MannyXR_right (male hands), and SDKM_QuinnXR_left and SDKM_QuinnXR_right (female hands).

Exporting the Virtual Hand Meshes from the VRTemplate - Locating the virtual hand meshes in the Content Browser

  1. Choose the pair of hand meshes you want to export. Right-click on them, then select Asset Actions followed by Bulk Export... from the context menu.

Exporting the Virtual Hand Meshes from the VRTemplate - Bulk exporting the virtual hand meshes

  1. In the file dialog that appears, choose a folder to save the exported hands, and click the Select Folder button to export the meshes in FBX format.

Exporting the Virtual Hand Meshes from the VRTemplate - Selecting the export folder

  1. The Unreal Editor will then display the FBX Export Options dialog. Leave the default settings unchanged and click Export All to proceed.

Exporting the Virtual Hand Meshes from the VRTemplate - The FBX export options

tip

If you're unsure whether the options are set to their defaults, you can click the Reset to Default button in the top-right corner of the dialog to restore the default settings.

  1. After exporting, you can find the FBX files for both hands in the directory you selected: /path/you/chose/for/bulk/export/Game/Characters/MannequinsXR/Meshes/.

Exporting the Virtual Hand Meshes from the VRTemplate - Exported virtual hand meshes in FBX format

Importing the Virtual Hand Meshes into Your Own Project

  1. Start by creating a new folder inside your project's Content Browser. Navigate to that folder, then press the Import button next to the + Add button at the top of the Content Browser.

Importing the Virtual Hand Meshes into Your Own Project - Create an empty folder and importing

  1. In the Import dialog that appears, navigate to the folder containing the virtual hand meshes. Select both FBX files and click the Open button.

Importing the Virtual Hand Meshes into Your Own Project - Selecting virtual hand mesh FBX files

  1. The Unreal Editor will display the FBX Import Options dialog. Leave the default settings unchanged and click Import All to proceed.

Importing the Virtual Hand Meshes into Your Own Project - The FBX import options

tip

If you're unsure whether the options are set to their defaults, you can click the Reset to Default button in the top-right corner of the dialog to restore the default settings.

  1. After the import process is done, a dialog will display the import logs. Any errors or warnings encountered during the import process will be shown here.

Importing the Virtual Hand Meshes into Your Own Project - The FBX import logs

note

The following warning can be safely ignored:

FBXImport: Warning: No smoothing group information was found in this FBX scene. Please make sure to enable the 'Export Smoothing Groups' option in the FBX Exporter plug-in before exporting the file. Even for tools that don't support smoothing groups, the FBX Exporter will generate appropriate smoothing data at export-time so that correct vertex normals can be inferred while importing.

  1. The imported virtual hand meshes should now appear in the folder you selected in the Content Browser. Unreal Engine will create a Skeletal Mesh, a Skeleton, and a Physics Asset for each imported mesh, along with a default Material asset shared between both virtual hand meshes.

Importing the Virtual Hand Meshes into Your Own Project - Imported virtual hand meshes

  1. You can choose to keep or modify the default material. However, since the SenseGlove Unreal Engine Plugin provides a default material, we choose to delete the default material created by Unreal Engine during the import process. We'll assign the SenseGlove default material to the imported virtual hand meshes in the next steps. Right-click on the default material and select Delete.

Importing the Virtual Hand Meshes into Your Own Project - Deleting the default material

  1. In the Delete Assets dialog, click Force Delete to confirm the deletion of the default material.

Importing the Virtual Hand Meshes into Your Own Project - Deleting the default material confirmation

  1. Open the Skeletal Mesh asset for the left hand and assign the M_SenseGlove_VirtualHand material from the Asset Details panel.

Importing the Virtual Hand Meshes into Your Own Project - Assigning the SenseGlove material to the left virtual hand mesh

  1. Repeat the process for the Skeletal Mesh asset of the right hand, and assign the M_SenseGlove_VirtualHand material in the Asset Details panel.

Importing the Virtual Hand Meshes into Your Own Project - Assigning the SenseGlove material to the right virtual hand mesh

  1. Return to the Content Browser by closing all asset windows and click the Save All button to save all imported virtual hand mesh assets to disk.

Importing the Virtual Hand Meshes into Your Own Project - Saving all virtual hand mesh assets

  1. In the Save Content dialog, choose Save Selected to confirm the saving all action.

Importing the Virtual Hand Meshes into Your Own Project - Saving all virtual hand mesh assets confirmation

Setting up the Rigid Bodies

  1. Open the Physics Asset for the left virtual hand mesh by double-clicking it in the Content Browser. This will open the PhAT (Physics Asset Tool) editor, where the virtual hand mesh for the left hand will appear with a default physics body, usually shaped as a capsule.

Setting up the Rigid Bodies - The Unreal PhAT Editor

  1. In the Tools panel, under the Body Creation section, locate the Primitive Type dropdown and select Box instead of the default Capsule shape. Then, click the Generate All Bodies button at the bottom of the Tools panel to create a new physics body.

Setting up the Rigid Bodies - Generating a Box physics body

  1. After generating the new body, some adjustments are required for optimal interactions inside your VR simulations. Press the r key on your keyboard to enter scaling mode and use the arrows to resize the physics body. To reposition the body, press the w key to switch to translation mode. For adjusting the rotation, press the e key. Toggle between these modes as needed to fine-tune the physics body to your requirements.

Setting up the Rigid Bodies - Adjusting the generated physics body

  1. You can always revisit and adjust the rigid body later after testing its impact in your VR simulations. For now, save the asset and close the PhAT editor.

Setting up the Rigid Bodies - The adjust phsyics body

  1. Repeat the same procedure for the right virtual hand mesh.

note

An older yet still relevant video tutorial demonstrating a similar procedure is also available.

Setting up the SenseGlove Grab and Touch Sockets

To ensure the Grab/Release and Touch systems function correctly, multiple sockets must be set up on each virtual hand mesh with precise locations and rotations. Before version v2.1.0 of the SenseGlove Unreal Engine Plugin, this was a manual and time-consuming process. However, with the v2.1.0 release, the plugin now includes the SenseGlove Sockets Editor, a built-in tool specifically designed for this task.

note

If for any reason you still prefer to manually set up the sockets, a detailed video tutorial is available.

Accessing the SenseGlove Sockets Editor

The SenseGlove Sockets Editor can be utilized in three ways:

  1. By right-clicking on any Skeleton or Skeletal Mesh asset inside the Unreal Content Browser.

Setting up the SenseGlove Grab and Touch Sockets - Content Browser

tip

You can also perform Sockets Editor actions in bulk by selecting multiple assets of the same type and right-clicking on one of them. Note that if the selected assets are not all of the same type, Sockets Editor actions will not appear (e.g. selecting assets of type Skeletons and Skeletal Meshes together).

Setting up the SenseGlove Grab and Touch Sockets - Content Browser bulk actions

  1. From the Asset menu in the Skeleton Editor or Skeletal Mesh Editor for any open Skeleton or Skeletal Mesh asset.

Setting up the SenseGlove Grab and Touch Sockets - Skeleton Editor or Skeletal Mesh Editor Asset menu

  1. From the Skeleton Editor or Skeletal Mesh Editor toolbar for any open Skeleton or Skeletal Mesh asset.

Setting up the SenseGlove Grab and Touch Sockets - Skeleton Editor or Skeletal Mesh Editor toolbar

The SenseGlove Sockets Editor currently offers two actions:

  1. Add SenseGlove Sockets: which adds and sets up the SenseGlove grab and touch sockets to any virtual hand mesh that adheres to the Epic rig and bone structure.
  2. Clear Existing Sockets: which destructively clears all existing sockets; SenseGlove or otherwise, from any mesh.

important

Simply performing any of these actions won't permanently modify your assets. In fact, if you close the Unreal Editor without saving your assets first, all changes performed by the SenseGlove Sockets Editor will be lost forever. This is by design and the plugin will leave this final choice to the user. So, in order to apply the changes permanently, you must save the assets manually.

Adding the SenseGlove Sockets

When you invoke the Add SenseGlove Sockets action, the Sockets Editor will prompt you for confirmation:

Adding the SenseGlove Sockets - Confirmation

If it succeeds at adding the standard SenseGlove sockets, you will receive a confirmation message:

Adding the SenseGlove Sockets - Success

After closing the dialog, the editors for the affected Skeleton and Skeletal Mesh assets will open, displaying the newly added sockets:

Adding the SenseGlove Sockets - Added sockets

To ensure the changes persist, save the assets to disk.

note

The Add SenseGlove Sockets action can fail for various reasons, so it's important to investigate and identify the cause if an issue arises.

Adding the SenseGlove Sockets - Added sockets failure

Adding the SenseGlove Sockets - Added sockets failure

important

A common cause of failure is that the SenseGlove sockets have already been set up, or the meshes you’re using already have the necessary sockets. In this case, consider using the Clear Existing Sockets action first.

caution

Another common cause of failure is if your virtual hand meshes share a skeleton. As noted in the Compatible Virtual Hand Meshes section, the SenseGlove Sockets Editor does not support skeletal meshes that share their skeleton. You may need to export and re-import the virtual hand meshes in in a compatible manner first.

In any case, the SenseGlove Sockets Editor reports all failures in the Unreal Editor logs. To view and investigate the logs, simply head to the Window menu and click on Output Log:

Adding the SenseGlove Sockets - Accessing the Unreal Editor output logs

For example, in the following screenshots the following errors are stated: Socket 'GrabAttachPoint' already exists on '/Game/SGHandbook/SKM_MannyXR_left.SKM_MannyXR_left'; refuse to add a duplicate!.

LogGeneric: Error: [ERROR C:\Users\mamadou\Desktop\dev\SGHandbook\Plugins\SenseGlove\Source\SenseGloveEditor\Private\SGEditor\SGAssetUtils.cpp FSGAssetUtils::FImpl::AddSocket 394] Socket 'GrabAttachPoint' already exists on '/Game/SGHandbook/SKM_MannyXR_left.SKM_MannyXR_left'; refuse to add a duplicate!
LogGeneric: Error: [ERROR C:\Users\mamadou\Desktop\dev\SGHandbook\Plugins\SenseGlove\Source\SenseGloveEditor\Private\SGEditor\SGAssetUtils.cpp FSGAssetUtils::FImpl::AddGrabAttachPointSocket 442] Failed to add the socket 'GrabAttachPoint' to '/Game/SGHandbook/SKM_MannyXR_left.SKM_MannyXR_left'!
LogGeneric: Error: [ERROR C:\Users\mamadou\Desktop\dev\SGHandbook\Plugins\SenseGlove\Source\SenseGloveEditor\Private\SGEditor\SGAssetUtils.cpp FSGAssetUtils::FImpl::AddSenseGloveSockets 587] Failed to add the grab attach point socket to asset '/Game/SGHandbook/SKM_MannyXR_left.SKM_MannyXR_left'!
LogGeneric: Error: [ERROR C:\Users\mamadou\Desktop\dev\SGHandbook\Plugins\SenseGlove\Source\SenseGloveEditor\Private\SGEditor\SGAssetUtils.cpp FSGAssetUtils::FImpl::AddSenseGloveSockets 741] Failed to add the SenseGlove sockets to the asset '/Game/SGHandbook/SKM_MannyXR_left.SKM_MannyXR_left'!

Adding the SenseGlove Sockets - Sockets already exists error

Clearing All Existing Sockets

When you invoke the Clear Existing Sockets action, the Sockets Editor will ask for your confirmation:

Clearing All Existing Sockets - Confirmation

If successful, you will receive a message indicating all the existing sockets have been cleared:

Clearing All Existing Sockets - Success

After closing the dialog, the editors for the affected Skeleton and Skeletal Mesh assets will open, displaying the affected assets with all sockets cleared:

Clearing All Existing Sockets - Sockets cleared

Configuring the SGPawn and Plugin Virtual Hand Mesh Settings

The final step in setting up the virtual hand meshes is to configure the SGPawn and Plugin Virtual Hand Mesh Settings to ensure they utilize the newly created virtual hand meshes.

Please visit Setting Up SGPawn, The Virtual Hand Mesh Settings, and how to setup the Wrist Tracking Hardware sections for more information.

SGPawn Configuration

In the SGPawn Blueprint class, make sure to assign the appropriate Skeletal Mesh Asset to the following components:

  • HandLeft
  • HandRight
  • RealHandLeft
  • RealHandRight

This ensures that the correct hand meshes are used for both virtual and real hands.

The SGPawn and the Plugin Virtual Hand Mesh Settings - SGPawn settings

Plugin Virtual Hand Mesh Settings

Next, navigate to Project Settings > Plugins > SenseGlove > Virtual Hand Settings > Mesh Settings and specify the correct left and right-hand meshes for:

  • Left Hand Reference Mesh
  • Right Hand Reference Mesh

This configuration guarantees that the tracking system correctly interprets the bone transforms of the virtual hand meshes when generating FXRMotionControllerData. Additionally, it allows the animation system to accurately use these bone transforms when processing FXRMotionControllerData and animating the virtual hand meshes.

The SGPawn and the Plugin Virtual Hand Mesh Settings - Plugin settings