Offline retargeting converts a motion created for a source character to a new motion suitable for the new target character. The resulting motion can be saved to a motion file so it can be used natively for the new character.
Perform Retarget Using Python API
User can also utilize the Python API to perform retarget. Since our retarget algorithm require matching pairs between joints from both source and target skeletons, we need to define the joint name mappings for both skeletons. A joint name map can be defined manually, or we have developed a set of heuristic to find these name mapping automatically.
Perform Retarget with Automatic Joint Name Mapping
The following are python commands for retargeting :
scene.run('motion-retarget.py') # need to run the retarget script first before calling the retarget functions in the script file retargetMotionWithGuessMap(motionName, srcSkelName, tgtSkelName, outDir)
Here 'motionName' indicate the motion corresponds to the source skeleton that needs to be retarget to target skeleton. srcSkelName and tgtSkelName means the name of source/target skeletons. outDir is the output directory after retarget is finished.
Perform Retarget with User Defined Joint Name Mapping :
Sometimes the heuristic guess map may not produce desired results. Thus user may also define the joint name mapping themselves. The following are python commands for retargeting :
scene.run('motion-retarget.py') # need to run the retarget script first before calling the retarget functions in the script file retargetMotionWithMap(motionName, srcSkelName, tgtSkelName, outDir, srcMapName, tgtMapName)
Here motionName, srcSkelName, tgtSkelName, outDir are defined similarly as in function retargetMotionWithGuessMap. srcMapName and tgtMapName are the joint mapping for source and target skeletons.
Advanced Retarget Command :
The above Python functions provide simplified interface to access the retarget functionality in SmartBody.
(Todo : better explanation of retargeting process in SmartBody. How to use motion.retarget and motion.constrain API to perform advanced retargeting )