The SteamVR_Skeleton_Poser script is designed to function independently from the SteamVR Interaction System and can be added to your own systems, but the SteamVR Interaction system works with it right out of the box and is a great way to quickly try it out.
SteamVR_Skeleton_Poses are ScriptableObjects that contain a particular hand pose and some per-finger animation info.
Multiple poses can be added to and modified via the SteamVR_Skeleton_Poser script with its handy UI. You can add any number of poses to one Poser, but you will likely only need a few at most. Using the buttons in the pose editor, new poses can be created, pose data can be copied between poses, pose data can be mirrored, poses can be reset to a variety of bases, and changes to skeletons in the scene view can be saved as changes to a pose. You can also add per-finger additive animation via the finger movement dropdowns. This lets the fingers move based on the skeleton input while remaining constrained to the pose. There are several types of finger movement:
- Static – no finger movement. Only use pose.
- Free – free finger movement. Ignore pose.
- Extend – fingers can lift up to a fully extended position, but not curl any farther down than where the pose has them
- Contract – fingers can curl to a fully contracted position, but cannot open any further than where the pose has them.
Using the Poser’s Blending Editor tab, you can set up blending behaviours to mix and stack multiple poses in complex ways. Think of the blending editor as an animator controller, and the poses as animations. There are three types of blending behaviours you can add: Manual, analog action, or boolean action. Manual behaviours will have to be driven by code, with an easy call of:
Poser.SetBlendingBehaviourValue(string behaviourName, float value)
Analog and boolean action behaviours, on the other hand, are automatically driven by a chosen action. The smoothing value will be the speed of smoothing applied to them, with 0 for none. Smoothing is not required for analog actions, but is recommended for Boolean-driven behaviours as they will look much… smoother.
Using the Skeleton Poser with the SteamVR Interaction system
The Poser component will work automatically with the SteamVR Interaction system. All you need to do is add the SteamVR_Skeleton_Poser script to an interactable GameObject. There are a couple settings on the interactable you should make sure to change though:
Interactable.HideHandOnAttach. This would hide your beautiful poses if you left it on!
Interactable.HideControllerOnAttach. This will make sure your controller doesn't get in the way of your hand poses.
- If you're creating an interactable that you want to be able to pick up, add the
Throwablescript to it.
- If you want that throwable to not pass through the environment, set only these attachment flags:
SnapOnAttach, DetachFromOtherHand, VelocityMovement, TurnOffGravity.
That is all that is needed to get a simple interactable with poser support.
Using the Skeleton Poser with Your Own Framework
As also mentioned before, the SteamVR_Skeleton_Poser script is designed to function independently from the SteamVR Interaction System. If you are using the
SteamVR_Behaviour_Skeleton script to animate your hand, you can tell it to blend to the output of a particular poser with a call of
If you are using a different solution to animate your skeleton, the Poser can generate poses on command in the format of the
SteamVR_Skeleton_PoseSnapshot dataclass, which holds object offset and position/rotation for all the bones. Call
poser.GetBlendedPose, passing either a
SteamVR_Behaviour_Skeleton or a
SteamVR_Input_Sources hand identifier. This will give you a fully composited pose according to the various behaviours and options on that particular poser, which you can apply freely to your skeleton.
Check out this video for another overview of the system and a step-by-step demonstration of setting up poses!