The sample demonstrates how to integrate Body Tracking using Movement SDK for MetaPerson avatars.
- Unity 2022.3.17f1 or newer
- Meta XR Core SDK and Meta XR Interaction SDK OVR v68 or newer
- Movement SDK v6.0.0
- Clone this repository to your computer
- Open the project in Unity 2022.3.17f1 or newer.
- Set Hand Tracking Support to Controllers And Hands and Body Tracking Support to Required for OculusProjectConfig (Assets -> Oculus).
- Build and run any of the sample scenes:
Assets/AvatarSDK/MetaPerson/QuestHandTrackingSample/Scenes/MetaPersonQuestHandTrackingSample.unity
Assets/AvatarSDK/MetaPerson/QuestHandTrackingSample/Scenes/MetaPersonQuestHipPinningSample.unity
- Add a MetaPerson avatar from the MetaPerson Creator into a unity scene.
- Right click on the model in the Hierarchy window and choose
Movement -> Setup Character for Body Tracking -> Format: MetaPerson Male
. ChooseFormat: MetaPerson Female
if you are using the MetaPerson Female model. - It will add the OVRToMetaPersonSkeletonSync component to the model and do initial setup.
If you load avatars at runtime, use the MetaPersonBodyTrackingSetupHelper for configuration.
MetaPersonBodyTrackingSetupHelper.SetupMetaPersonForBodyTracking(metaPersonMaleAvatar, MetaPersonSkeletonType.Male);
This component applies Body Tracking data to a MetaPerson avatar.
Key properties:
- Twist 1 Coeff and Twist 2 Coeff impact on skin twist in a region between the forearm and the hand.
- Move Hips specifies if the position of the Hips node is updated. If it is disabled, only rotation is applied to the Hips node.
- Skeleton Mapping specifies the mapping between OVR and MetaPerson skeletons.
- Arms Stretchable specifies if the arms length can be increased to align model's hands with OVR hands.
- Feet Position In World Space specifies if the feet positions in world space. Workaround for oculus-samples/Unity-Movement#58.
- Sync Bones With Other Model if true, some bones positions are taken from the Source Bones. Otherwise, they are provided by the OVRBody.
- Source Bones Model contains a game object with the OVR Skeleton structure from which bones to sync are taken.
- Source Bones is a list of transforms to which bones positions/rotations are synchronized with.
Sample scenes can be found in the Assets/AvatarSDK/MetaPerson/QuestHandTrackingSample/Scenes
directory.
- MetaPersonQuestHandTrackingSample - the basic sample that demonstrates how to configure MetaPerson avatars for body tracking.
- MetaPersonQuestHipPinningSample - this sample shows how to sync MetaPerson model's bones with another model. In this case OVR rig uses HipPinning and Grounding constraints and the MetaPerson models are synchonized with this rig.
- MetaPersonQuestModelChangingSample - this sample is based on the MetaPersonQuestHipPinningSample and demonstrates how to load MetaPerson avatars at runtime and replace the existed model on the scene.
If you have any questions or issues with the sample, please contact us support@avatarsdk.com.