Some features in the animation graph requires that poses are expressed in character (relative to animation player root) or global space. The motivating case is inverse kinematics: for two-bone inverse kinematics all bone transforms in a frame must be expressed w.r.t. a common reference frame (i.e. they must be in either character or global space).
Solution
Rather than having a single pose type, we differentiate statically between BonePoseFrame, CharacterPoseFrame and GlobalPoseFrame types. The pose pass then returns an Option<PoseFrame>, where PoseFrame contains an enum which wraps one of the three pose types listed above.
This brings our handling of poses more in line with what we already do for parameter values, which has worked well so far.
Space conversion nodes were added to convert from one kind of pose to another. Lastly, a ExtendSkeleton node was added to ensure that all skeleton bone transforms are in a pose (since the assumption is that if a bone is not contained in a pose then it remains as-is).
The ergonomics of this are subject to change (and feedback is welcome!) but it should be enough to get started with inverse kinematics.
Objective
Some features in the animation graph requires that poses are expressed in character (relative to animation player root) or global space. The motivating case is inverse kinematics: for two-bone inverse kinematics all bone transforms in a frame must be expressed w.r.t. a common reference frame (i.e. they must be in either character or global space).
Solution
Rather than having a single pose type, we differentiate statically between
BonePoseFrame
,CharacterPoseFrame
andGlobalPoseFrame
types. The pose pass then returns anOption<PoseFrame>
, wherePoseFrame
contains an enum which wraps one of the three pose types listed above.This brings our handling of poses more in line with what we already do for parameter values, which has worked well so far.
Space conversion nodes were added to convert from one kind of pose to another. Lastly, a
ExtendSkeleton
node was added to ensure that all skeleton bone transforms are in a pose (since the assumption is that if a bone is not contained in a pose then it remains as-is).The ergonomics of this are subject to change (and feedback is welcome!) but it should be enough to get started with inverse kinematics.