pymel.core.animation.retarget

retarget(*args, **kwargs)

This command is used to take motion from one character and retarget it to a second character of a different size.

Flags:
Long name (short name) Argument Types Properties
endFrame (end) int ../../../_images/create.gif
 
Specify the retargeting end frame. Default is 10.
lowerBody (lb) unicode ../../../_images/create.gif
 

Specify the desired retargeting technique for the lower body. Valid options are: “jointRotationsOnly”, “scaledFootPlacement” and “absoluteFootPlacement”. Default is scaledFootPlacement.

lowerScale (ls) unicode ../../../_images/create.gif
 

Specify the way scale is calculated for the lower body. Valid techniques are: “hipToFoot”, “hipToToe”, “overallHeight”, and “other”. This option is used when the lowerBody flag is set to anything other than “jointRotationsOnly”. Default is hipToFoot. When “other” is used, the lowerScaleFactor flag should be used to specify the scale factor.

lowerScaleFactor (lsf) float ../../../_images/create.gif
 
Specify the scale factor for the lower body. This option is only used when the lowerScale is set to “other”.
maintainOffset (mo) bool ../../../_images/create.gif
 
When this flag is used, the root of the target character will stay the same distance from the source as at the rest pose.
restPoseFrame (rpf) int ../../../_images/create.gif
 

The retargeting solution takes the rest pose of the characters into consideration. For example, one character may be bowlegged with respect to the other in the rest pose. When retargeting animation from the bowlegged character to the non-bowlegged character, the solution will take the rest pose into account so that the target character will receive the walk animation without the bowlegged aspects of the walk. The user has 2 options for specifying a restPose: specifying a frame number at which the rest pose is defined, or defining a retargeting rest pose using the Retargeting-SetRestPose menu item. If you use a frame number for the rest pose, the best practice is to use a frame that does not lie within the range of frames being retargeted. This allows you to retarget without wiping out the rest pose.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

scaleHandsFrom (shf) unicode ../../../_images/create.gif
 

Specify where the arms are scaled from. Valid arguments are: “shoulder”, “root” and “origin”. This option is only used when the upperBody flag is set to “scaledHandPlacement”. Defaults is shoulder.

startFrame (s) int ../../../_images/create.gif
 
Specify the retargeting start frame. Default is 0.
upperBody (ub) unicode ../../../_images/create.gif
 

Specify the desired retargeting technique for the upper body. Valid techniques are: “jointRotationsOnly”, “scaledHandPlacement”, “absoluteHandPlacement” and “maintainHandDistance”. Default is jointRotationsOnly.

upperScale (us) unicode ../../../_images/create.gif
 

Specify the way scale is calculated for the upper body. Valid techniques are: “shoulderToWrist”, “shoulderToHand”, “followLower”, and “other”. This option is used when the upperBody flag is set to anything other than “jointRotationsOnly”. Defaults is shoulderToHand. When “other” is used, the upperScaleFactor flag should be used to specify the scale factor.

upperScaleFactor (usf) float ../../../_images/create.gif
 
Specify the scale factor for the upper body. This option is used when the upperScale is set to “other”.
useExistingKeys (uek) bool ../../../_images/create.gif
 

When this flag is used, the existing keys on the target are used as a hint to help guide the retargeting solution. This option sometimes allows the solver to narrow in on a better solution.

Derived from mel command maya.cmds.retarget

Example:

import pymel.core as pm

import maya.cmds as cmds

# retarget the motion of bob onto joe using the scaled foot placement solver
#
pm.retarget( 'bob', 'joe', startFrame=0, endFrame=30, lowerBody='scaledFootPlacement' )
# Retarget the motion of birdman onto splinterFace using the scaled foot placement
# solver (default), using the hip-to-toe measurement to compute the scale.
# Use the hierarchy location at frame -5 as the rest pose.
#
pm.select( 'splinterFace', 'birdman', r=True )
pm.retarget( startFrame=0, endFrame=30, lowerScale='hipToToe', restPoseFrame=-5 )

Previous topic

pymel.core.animation.reroot

Next topic

pymel.core.animation.rotationInterpolation

Core

Core Modules

Other Modules

This Page