pymel.core.animation.bakeClip¶
- bakeClip(*args, **kwargs)¶
This command is used to bake clips and blends into a single clip.
Flags:
Long Name / Short Name Argument Types Properties blend / b int, int Specify the indices of the clips being blended. clipIndex / ci int Specify the index of the clip to bake. keepOriginals / k bool Keep original clips in the trax editor and place the merged clip into the visor. The default is to schedule the merged clip, and to keep the original clips in the visor. name / n unicode Specify the name of the new clip to create. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.bakeClip
Example:
import pymel.core as pm # First create a simple character. # pm.cone( n='bakeCone' ) # Result: [nt.Transform(u'bakeCone'), nt.MakeNurbCone(u'makeNurbCone1')] # pm.character( n='coneCharacter' ) # Result: nt.Character(u'coneCharacter') # # Create some animation. # pm.select( 'bakeCone', r=True ) pm.currentTime( 0 ) # Result: 0.0 # pm.setKeyframe( 'bakeCone.tx', v=0 ) # Result: 1 # pm.currentTime( 10 ) # Result: 10.0 # pm.setKeyframe( 'bakeCone.tx', v=10 ) # Result: 1 # # Make a clip. # pm.clip( 'coneCharacter', startTime=0, endTime=10, name='up' ) # Result: [u'up'] # # Create a second clip. # pm.select( 'bakeCone', r=True ) pm.currentTime( 15 ) # Result: 15.0 # pm.setKeyframe( 'bakeCone.tx', v=15 ) # Result: 1 # pm.currentTime( 25 ) # Result: 25.0 # pm.setKeyframe( 'bakeCone.tx', v=0 ) # Result: 1 # # Make a clip. # pm.clip( 'coneCharacter', startTime=15, endTime=25, name='down' ) # Result: [u'down'] # # Blend the clips, with a linear weighting function. # scheduler = pm.character('coneCharacter', query=True, sc=True) pm.clipSchedule( scheduler, b=(0, 1) ) blendNode = pm.clipSchedule( scheduler, q=True, bn=(0, 1)) pm.setKeyframe( blendNode[0], at='weight', t=0.0, v=0.0 ) # Result: 1 # pm.setKeyframe( blendNode[0], at='weight', t=1.0, v=1.0 ) # Result: 1 # # Bake out the two clips and the blend. # pm.bakeClip( 'coneCharacter', ci=[0, 1], name='bakedUpAndDown' ) # Result: u'bakedUpAndDown1' #