Retargeting

Retargeting

Module description

This section describes the functions used to retarget animations.

Retargeting takes an animation pre-recorded for a character, and uses that same animation to drive the movements of a different target character that may have a very different skeleton, dimensions or characteristics. For retargeting, you need to have a source character, an HIKCharacterState that contains its current position (typically drawn from a pre-recorded animation) and a destination character. The retargeting solver creates a new pose for the destination character that mimics the source character's pose, and stores this pose in an HIKCharacterState that you provide. You retrieve this pose and apply it back to the destination character in your game.

You can also specify a variety of character properties for your destination character that control the operation of the retargeting solver. For example, you can provide Reach values that influence how closely the different parts of the destination character's body should match the positions of the source character's body. This step is done through a call to the IK solver after the retargeting process.

Modules

 Low-LoD Retargeting
 This page details the functions used to perform a retargeting for a character with a low level of detail.
 

Functions

void HIKSolveForCharacter (const HIKCharacter *pDstCharacter, HIKCharacterState *pCharacterState, const HIKCharacter *pSrcCharacter, const HIKCharacterState *pSrcCharacterState, HIKEffectorSetState *pEffectorSetState, const HIKPropertySetState *pDstPropertyState, const HIKPropertySetState *pSrcPropertyState)
 Given source character pSrcCharacter with HIKCharacterState pSrcCharacterState, calculate HIKCharacterState pCharacterState for destination character pDstCharacter. More...
 
void HIKSolveForCharacterRetarget (const HIKCharacter *pDstCharacter, HIKCharacterState *pDstCharacterState, const HIKCharacter *pSrcCharacter, const HIKCharacterState *pSrcCharacterState, const HIKPropertySetState *pDstPropertyState)
 Simple rotation mapper between pSrcCharacter and pDstCharacter. More...
 
void HIKSolveForCharacterPrepareEffectorSet (const HIKCharacter *pDstCharacter, HIKCharacterState *pDstCharacterState, const HIKCharacter *pSrcCharacter, const HIKCharacterState *pSrcCharacterState, HIKEffectorSetState *pEffectorSetState, const HIKPropertySetState *pDstPropertyState, const HIKPropertySetState *pSrcPropertyState)
 Sync IK pEffectorSetState on source FK pSrcCharacterState and adjust IK relative to destination character pDstCharacter. More...
 

Function Documentation

void HIKSolveForCharacter ( const HIKCharacter pDstCharacter,
HIKCharacterState pCharacterState,
const HIKCharacter pSrcCharacter,
const HIKCharacterState pSrcCharacterState,
HIKEffectorSetState pEffectorSetState,
const HIKPropertySetState pDstPropertyState,
const HIKPropertySetState pSrcPropertyState 
)

Given source character pSrcCharacter with HIKCharacterState pSrcCharacterState, calculate HIKCharacterState pCharacterState for destination character pDstCharacter.

This function calls the following functions in order.

Parameters
pDstCharacterDestination character.
[out]pCharacterStateHIKCharacterState for the destination character. This HIKCharacterState is used to store the final solution.
pSrcCharacterSource character.
pSrcCharacterStateHIKCharacterState containing the current pose of the source character, which is to be adapted to the destination character.
pEffectorSetStateHIKEffectorSetState used for a full-body IK pass after the retargeting. Remember to set appropriate solving steps for this state. See HIKSetIKSolvingStep().
pDstPropertyStateHIKPropertySetState containing all character properties to be used by the solver for the destination character.
pSrcPropertyStateHIKPropertySetState for the source character. This state is only used if you have enabled the HIKSolvingStepContact solving step in your HIKEffectorSetState. If so, the property HIKFootBottomToAnkleId will be read from this HIKPropertySetState to define the height of the source character's ankles. This value is used to adapt the height of the poses generated for the destination character.
+ Examples:
void HIKSolveForCharacterPrepareEffectorSet ( const HIKCharacter pDstCharacter,
HIKCharacterState pDstCharacterState,
const HIKCharacter pSrcCharacter,
const HIKCharacterState pSrcCharacterState,
HIKEffectorSetState pEffectorSetState,
const HIKPropertySetState pDstPropertyState,
const HIKPropertySetState pSrcPropertyState 
)

Sync IK pEffectorSetState on source FK pSrcCharacterState and adjust IK relative to destination character pDstCharacter.

Parameters
pDstCharacterDestination character.
[out]pDstCharacterStateHIKCharacterState for the destination character. This HIKCharacterState is used to store the final solution.
pSrcCharacterSource character.
pSrcCharacterStateHIKCharacterState containing the current pose of the source character, which is to be adapted to the destination character.
[out]pEffectorSetStateHIKEffectorSetState set up by this function to control a pass through the IK solver to finalize the retargeting.
pDstPropertyStateHIKPropertySetState containing all character properties to be used by the solver for the destination character.
pSrcPropertyStateHIKPropertySetState for the source character. This state is only used if you have enabled the HIKSolvingStepContact solving step in your HIKEffectorSetState. If so, the property HIKFootBottomToAnkleId will be read from this HIKPropertySetState to define the height of the source character's ankles. This value is used to adapt the height of the poses generated for the destination character.
void HIKSolveForCharacterRetarget ( const HIKCharacter pDstCharacter,
HIKCharacterState pDstCharacterState,
const HIKCharacter pSrcCharacter,
const HIKCharacterState pSrcCharacterState,
const HIKPropertySetState pDstPropertyState 
)

Simple rotation mapper between pSrcCharacter and pDstCharacter.

Parameters
pDstCharacterDestination character.
[out]pDstCharacterStateHIKCharacterState for the destination character. This HIKCharacterState is used to store the final solution.
pSrcCharacterSource character.
pSrcCharacterStateHIKCharacterState containing the current pose of the source character, which is to be adapted to the destination character.
pDstPropertyStateHIKPropertySetState containing all character properties to be used by the solver for the destination character.