Create a Hand Grab Pose (PC)
In this tutorial, you learn how to record a custom hand grab pose with Interaction SDK to control how your hands conform to a grabbed object. Once you record a pose, you can adjust its fingers and scale, mirror, and enable it to work with different surfaces.
This tutorial is only for Android devices because it requires Link. For the Mac version of this tutorial, see
Create a Hand Grab Pose (Mac). To try pose recognition in a pre-built scene, see the
PoseExamples scene.
Note: This tutorial requires Link, which doesn’t support Mac, so you can’t use a Mac for this tutorial.
Before you can record poses for an object, there are a few settings you need to configure.
Open the Unity scene where you want to record hand grab poses.
Open the Hand Grab Pose Recorder window by selecting Meta > Interaction > Hand Grab Pose Recorder.
The window appears.
The Hand Grab Pose Recorder window.
In the window, set the required properties listed below.
Property | Description |
---|
Hand used for recording poses | The hand to record. This is either the left or right hand under OVRInteraction > OVRHands in the hierarchy. |
GameObject to record the hand grab poses for | The GameObject to record poses for. |
Prefabs provider for the hands to visualize the recorded poses | A GhostProvider that will instantly visualize the generated poses. This field will auto populate with the first found asset in the project (there is a default asset included in the package). |
HandGrab Interactable Data Collection (optional) | An asset that can store or load poses so they can survive the Play/Edit mode switch. If no asset is provided, a new one will be automatically generated when saving. |
Now it’s time to record a custom grab pose for the grabbable object.
Go into Play Mode.
Using the hand you chose in the previous section, wrap it around the GameObject you selected as a target.
Once your hand is in the desired pose, either press the Record key (Space by default, requires focus on the HandGrabPoseRecorder Window) or the RecordHandGrabPose button in the editor with your free hand.
In the scene, a HandGhost GameObject appears as a hand performing the recorded pose.
Repeat the previous step as many times as needed. There is no need to record left and right HandPoses since they can be mirrored later.
Before exiting Play Mode, click the Save To Collection button.
This stores the HandPoses in an asset that can be retrieved in Edit Mode. If you didn’t provide a collection asset, one is automatically generated.
Once you’ve recorded a pose, you can tweak, mirror, and duplicate it in Edit Mode for a more polished result.
In Edit Mode, click the Load From Collection button.
The recorded HandPoses are restored. Each restored pose has a GameObject that contains a HandGrabInteractable and HandGrabPose.
Tweak the generated HandPoses as needed using the following sections.
When you select a HandGrabPose, you should see a GhostHand representing that pose in the Scene window. If Gizmos are enabled in the editor, there are several circular handles around the joints of the GhostHand. These handles adjust the angle of flexion and abduction of each joint (abduction is only possible at the root of the fingers). Handles will not be shown for fingers set to Free in the HandPose.FingersFreedom field.
Select a HandGrabPose.
If Gizmos are enabled in the editor, several circular handles appear around the joints of the GhostHand.
The circular handles used to adjust each finger joint.Using the handles, adjust the joints until the fingers are positioned correctly.
A HandGrabPose on its own specifies just the pose of the wrist in relation to the object. But you can also indicate that this pose can be used along a surface. For example, grabbing a book at any point around its edge or a driving wheel around its circumference.
To specify the surface in which the HandGrabPose is valid, you can use one of these components that implement
IGrabSurface.
- CylinderGrabSurface: A cylinder with adjustable length, direction and maximum angle. Use it to grab circular or cylindrical objects such as the edge of the cup or the torch in the HandGrabExamples scene.
- SphereGrabSurface: A sphere. Place it in the center of a spherical object so you can grab it using the HandPose at any rotation.
- BoxGrabSurface: A rectangle with adjustable edges. Use it for grabbing rectangular objects at their edge like books, phones, or a table.
To add an IGrabSurface, follow these steps.
- Add one of the components listed above to the HandGrabPose GameObject.
- In Inspector, set the [Optional] Surface field of the HandGrabPose to the component.
- In the Scene window, move your mouse around the surface gizmo to visualize how the hand wrist will snap to the object.
- Use either the provided handles or fields in the GrabSurface inspector to adjust the surface shape so the hand stays within the desired bounds.
A HandGrabPose using the CylinderGrabSurface implementation of IGrabSurface.
If your application allows users to have custom scaled hands (the default behavior), you should provide some modified copies of the default (1x scale) HandGrabPose to the HandGrabInteractable. These modified copies should use the custom hand size so the system can interpolate between them and the default size to ensure the hand grab always looks well aligned.
- To create a scaled copy of the hands, do one of the following.
Option A: Duplicate the GameObject Duplicate the HandGrabPose GameObject (alongside its GrabSurface if it has one).
Adjust the GameObject’s local scale.
(Optional) Tweak the finger rotations and surface limits.
Assign the new GameObject to the HandGrabInteractable.
Option B: Use the scale slider In the HandGrabInteractable component, move the ScaledHandGrabPosesKeys slider to the 0.8x and 1.2x position.
Click the Add HandGrabPose Key at X scale button to create the keys.
(Optional) Tweak the fingers and surfaces in the newly created HandGrabPoint GameObjects under the HandGrabInteractable.
In the Inspector, move the ScaledHandGrabPosesKeys slider while watching the scene view to ensure that the transitions between the different hand sizes are smooth.
You can mirror a HandGrabPose either manually or automatically so the pose exists for both hands.
- To create a mirrored pose, do one of the following.
Option A: Mirror manually Duplicate the HandGrabInteractable.
In Inspector, change the Handedness property of each HandGrabPose GameObject.
Manually reposition each HandGrabPose so it aligns well.
Option B: Mirror automatically Under Inspector, in the HandGrabInteractable component, ensure the HandGrabPoses you created are listed in that hand’s HandGrabInteractable.
In the component, click the Create Mirrored HandGrabInteractable button.
The HandGrabInteractable is duplicated while mirroring all the HandGrabPoses into a new HandGrabInteractable.
(Optional) If the mirroring for the generated poses happened on the wrong axis, move the transform of the HandGrabPose to the desired position.