Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.

Synopsis

clipSchedule([absolute=boolean], [absoluteRotations=boolean], [allAbsolute=boolean], [allRelative=boolean], [blend=[uint, uint]], [blendNode=[uint, uint]], [blendUsingNode=string], [character=boolean], [clipIndex=uint], [cycle=float], [defaultAbsolute=boolean], [enable=boolean], [group=boolean], [groupIndex=uint], [groupName=string], [hold=time], [insertTrack=uint], [instance=string], [listCurves=boolean], [listPairs=boolean], [lock=boolean], [mute=boolean], [name=string], [postCycle=float], [preCycle=float], [remove=boolean], [removeBlend=[uint, uint]], [removeEmptyTracks=boolean], [removeTrack=uint], [rotationsAbsolute=boolean], [scale=float], [shift=int], [shiftIndex=uint], [solo=boolean], [sourceClipName=boolean], [sourceEnd=time], [sourceStart=time], [start=time], [track=uint], [weight=float], [weightStyle=uint])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

clipSchedule is undoable, queryable, and editable.

This command is used to create, edit and query clips and blends in the Trax editor. It operates on the clipScheduler node attached to the character. In query mode, if no flags are specified, returns an array of strings in this form: (clipName,clipIndex,clipStart,clipSourceStart,clipSourceEnd,clipScale,clipPreCycle,clipPostCycle,clipHold)

Return value

string Clip name

In query mode, return type is based on queried flag.

Keywords

character, clip, animation

Related

bakeClip, character, characterMap, clip, clipEditor

Flags

absolute, absoluteRotations, allAbsolute, allRelative, blend, blendNode, blendUsingNode, character, clipIndex, cycle, defaultAbsolute, enable, group, groupIndex, groupName, hold, insertTrack, instance, listCurves, listPairs, lock, mute, name, postCycle, preCycle, remove, removeBlend, removeEmptyTracks, removeTrack, rotationsAbsolute, scale, shift, shiftIndex, solo, sourceClipName, sourceEnd, sourceStart, start, track, weight, weightStyle
Long name (short name) Argument types Properties
clipIndex(ci) uint createquery
Specify the index of the clip to schedule. In query mode, returns an array of strings in this form: (clipName,index,start,sourceStart,sourceEnd,scale,preCycle,postCycle)

In query mode, this flag can accept a value.

start(s) time createquery
Specify the placement of the start of the clip
sourceStart(ss) time createquery
Specify where to start in the source clip's animation curves
sourceEnd(se) time createquery
Specify where to end in the source clip's animation curves
preCycle(prc) float createquery
Specify the number of times to repeat the clip before its normal start.
postCycle(poc) float createquery
Specify the number of times to repeat the clip after its normal end.
hold(ph) time createquery
Specify how long to hold the last value of the clip after its normal or cycled end.
scale(sc) float createquery
Specify the amount to scale the clip. Values must be greater than 0.
absolute(abs) boolean queryedit
This flag is now deprecated. Use aa/allAbsolute, ar/allRelative, ra/rotationsAbsolute, or da/defaultAbsolute instead. This flag controls whether the clip follows its keyframe values or whether they are offset by a value to maintain a smooth path.
absoluteRotations(abr) boolean queryedit
This flag is now deprecated. Use aa/allAbsolute, ar/allRelative, ra/rotationsAbsolute, or da/defaultAbsolute instead. If true, this overrides the abs/absolute flag so that rotation channels are always calculated with absolute offsets. This allows you to have absolute offsets on rotations and relative offsets on all other channels.
allAbsolute(aa) boolean edit
Set all channels to be calculated with absolute offsets. This flag cannot be used in conjunction with the ar/allRelative, ra/rotationsAbsolute or da/defaultAbsolute flags.
allRelative(ar) boolean edit
Set all channels to be calculated with relative offsets. This flag cannot be used in conjunction with the aa/allAbsolute, ra/rotationsAbsolute or da/defaultAbsolute flags.
rotationsAbsolute(ra) boolean edit
Set all channels except rotations to be calculated with relative offsets. Rotation channels will be calculated with absolute offsets. This flag cannot be used in conjunction with the aa/allAbsolute, ar/allRelative or da/defaultAbsolute flags.
defaultAbsolute(da) boolean edit
Sets all top-level channels except rotations in the clip to relative, and the remaining channels to absolute. This is the default during clip creation if no offset flag is specified. This flag cannot be used in conjunction with the aa/allAbsolute, ar/allRelative, or ra/rotationsAbsolute flags.
instance(instance) string create
Create an instanced copy of the named clip. An instanced clip is one that is linked to an original clip. Thus, changes to the animation curve of the original curve will also modify all instanced clips. The name of the instanced clip is returned as a string.
remove(rm) boolean create
This flag is used to remove a clip from the timeline. It must be used in conjunction with the ci/clipIndex flag. The specified clip will be removed from the timeline, but will still exist in the library and any instanced clips will remain in the timeline. To permanently remove a clip from the scene, the clip command should be used instead.
enable(en) boolean createquery
This flag is used to enable or disable a clip. It must be used in conjunction with the ci/clipIndex flag. The specified clip will be enabled or disabled.
blend(b) [uint, uint] createquery
This flag is used to blend two clips, whose indices are provided as flag arguments.
blendUsingNode(bun) string create
This flag is used if you want to blend using an existing blend node. It is used in conjunction with the blend flag. The blend flag specifies the clip indices for the blend. The name of an existing animBlend node should be supplied supplied as an argument for the blendUsingNode flag.
blendNode(bn) [uint, uint] query
This query only flag list all of the blend nodes associated with the blend defined by the two clip indices. This flag returns a string array.

In query mode, this flag can accept a value.

removeBlend(rb) [uint, uint] create
This flag is used to remove an existing blend between two clips, whose indices are provided as flag arguments.
character(ch) boolean query
This flag is used to query which characters this scheduler controls. It returns an array of strings.
listCurves(lc) boolean createquery
This flag is used to list the animation curves associated with a clip. It should be used in conjunction with the clipIndex flag, which specifies the clip of interest.
name(n) string createquery
This flag is used to query the name of the clip node associated with the specified clip index, or to specify the name of the instanced clip during instancing.

In query mode, this flag can accept a value.

sourceClipName(scn) boolean createquery
This flag is used to query the name of the source clip node associated with the specified clip index.
weight(w) float createquery
This flag is used in to set or query the weight of the clip associated with the specified clip index.
weightStyle(ws) uint createquery
This flag is used to set or query the weightStyle attribute of the clip associated with the specified clip index.
lock(l) boolean queryedit
This flag specifies whether clips on a track are to be locked or not. Must be used in conjuction with the track flag.
solo(so) boolean queryedit
This flag specifies whether clips on a track are to be soloed or not. Must be used in conjuction with the track flag.
mute(m) boolean queryedit
This flag specifies whether clips on a track are to be muted or not. Must be used in conjuction with the track flag.
track(t) uint createquery
Specify the track to operate on. For example, which track to place a clip on, which track to mute/lock/solo. In query mode, it may be used in conjuction with the clipIndex flag to return the track number of a clip, where track 1 is the first track of the character.

In query mode, this flag can accept a value.

insertTrack(it) uint create
This flag is used to insert a new empty track at the track index specified.
removeTrack(rt) uint create
This flag is used to remove the track with the specified index. The track must have no clips on it before it can be removed.
removeEmptyTracks(ret) boolean create
This flag is used to remove all tracks that have no clips.
shiftIndex(shi) uint createmultiuse
This flag allows multiple clips to be shifted by a certain number of tracks and works in conjunction with the shiftAmount flag. The flag specifies the index of the clip to shift. This flag can be used multiple times on the command line to specify a number of clips to shift.
shift(sh) int create
This flag allows multiple clips to be shifted by a certain number of tracks and works in conjunction with the shiftIndex flag. The flag specifies the number of tracks to shift the associated clips. Positive values shift the clips down an negative values shift the clips up.
listPairs(lp) boolean query
This query only flag returns a string array containing the channels in a character that are used by a clip and the names of the animation curves that drive the channels. Each string in the string array consists of the name of a channel, a space, and the name of the animation curve animating that channel. This flag must be used with the ci/clipIndex flag.
cycle(c) float createquery
This flag is now obsolete. Use the postCycle flag instead.
group(grp) boolean create
This flag is used to add (true) or remove (false) a list of clips (specified with groupIndex) into a group.
groupName(gn) string createquery
This flag is used to specify the group that should be added to. If no group by that name exists and new group is created with that name. By default if this is not specified a new group will be created.
groupIndex(gri) uint createmultiuse
This flag specifies a multiple number of clips to be added or removed from a group.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# First, create a character to hold the clips. The character will be
# a 3-bone skeleton named "arm".
#
cmds.select( d=True )
cmds.joint( p=(0, 0, 0) )
cmds.joint( p=(0, 4, 0)  )
cmds.joint( 'joint1', e=True, zso=True, oj='xyz' )
cmds.joint( p=(0, 8, -1) )
cmds.joint( 'joint2', e=True, zso=True, oj='xyz' )
cmds.joint( p=(0, 9, -2) )
cmds.joint( 'joint3', e=True, zso=True, oj='xyz' )
cmds.select( 'joint1', 'joint2', 'joint3', r=True )
cmds.character( name='arm' )
# Create some animation for the character. For this example the animation will
# be quite trivial.
#
cmds.select( 'joint3', r=True )
cmds.currentTime( 0 )
cmds.setKeyframe( 'joint3.rx' )
cmds.currentTime( 10 )
cmds.setKeyframe( 'joint3.rx', v=90 )
cmds.currentTime( 20 )
cmds.setKeyframe( 'joint3.rx', v=0 )
# Create a clip for the current animation named "handWave"
#
cmds.clip( 'arm', startTime=0, endTime=20, name='handWave' )
# Query the name of the clipScheduler for this character
#
cmds.character( 'arm', query=True, sc=True )
# Result: armScheduler1
# Create a 2nd animation for the character.
#
cmds.select( 'joint2', r=True )
cmds.currentTime( 0 )
cmds.setKeyframe( 'arm' )
cmds.currentTime( 10 )
cmds.setKeyframe( 'joint2.rx', v=45 )
cmds.setKeyframe( 'joint2.ry', v=-20 )
cmds.currentTime( 20 )
cmds.setKeyframe( 'joint2.rx', v=0 )
cmds.setKeyframe( 'joint2.ry', v=20 )
# Create a clip for the current animation named "elbowWave"
#
cmds.clip( 'arm', startTime=0, endTime=20, name='elbowWave' )
# Instance handeWave at time 10
#
cmds.clipSchedule( 'armScheduler1', instance='handWave', s=10 )
# Query the clip index of the latest instance of handWave. Each instance
# of a clip received a unique clipIndex. The clip index is used to
# edit and query data for existing clips.
#
cmds.clipSchedule( 'armScheduler1', name='handWave1', query=True, ci=True )
# Query whether the clip associated with index 2 is enabled or not
#
cmds.clipSchedule( 'armScheduler1', ci=2, query=True, enable=True )
# Query the name of the clip associated with index 2
#
cmds.clipSchedule( 'armScheduler1', ci=2, query=True, n=True )
# Query the weight of the clip associated with index 2
#
cmds.clipSchedule( 'armScheduler1', ci=2, query=True, weight=True )
# Modify the elbowWave clip to start at frame 10 instead of frame 0
#
cmds.clipSchedule( 'armScheduler1', start=10, ci=1 )
# Trim the start of the elbowWave clip to
# use the animation starting at frame 5 instead 0
#
cmds.clipSchedule( 'armScheduler1', sourceStart=5, ci=1 )
# Trim the end of the elbowWave clip to
# use the animation up to frame 15 instead 20
#
cmds.clipSchedule( 'armScheduler1', sourceEnd=15, ci=1 )
# Modify the handWave clip to have two cycles instead of 1
#
cmds.clipSchedule( 'armScheduler1', postCycle=1, ci=0 )
# list the animation curves associated with a particular clip
#
cmds.clipSchedule( 'armScheduler1', ci=2, listCurves=True )
# Move a particular clip to a particular track
#
cmds.clipSchedule( 'armScheduler1', track=2, ci=0 )
# Add a blend between clips 1 and 2
#
cmds.clipSchedule( 'armScheduler1', b=(1, 2) )
# Query the name of the blendNode between clips 1 and 2
#
cmds.clipSchedule( 'armScheduler1', q=True, bn=(1, 2) )
# Lock the first track and then query its state
#
cmds.clipSchedule( 'armScheduler1', track=1, e=True, lock=1 )
cmds.clipSchedule( 'armScheduler1', track=1, query=True, lock=True )
# Query the existing clips in the scheduler.
# In query mode, returns an array of strings in this form:
# (clipName,index,start,sourceStart,sourceEnd,scale,preCycle,postCycle,hold)
#
# In this case there are three scheduled clips:
#  2 instances of "handWave" and 1 of "elbowWave". The clip indices for "handWave" are 0
#  and 3. The clip index for "elbowWave" is 2. Note that the clip indices can be sparse
#  since a clip maintains its index as long as it is in the schedule (the TraX editor).
#
cmds.clipSchedule( 'armScheduler1', query=True )
# Result: handWave,0,0.000000,0.000000,20.000000,1.000000,0.00000,2.00000 elbowWave,1,0.000000,5.000000,15.000000,1.000000,0.00000,1.00000 handWave,2,10.000000,0.000000,20.000000,1.000000,0.00000,1.00000
#
# Shift clips 1 and 2 up 3 tracks
#
cmds.clipSchedule( 'armScheduler1', sh=-3, shi=1, shi=2 )
# Print out which anim curves animate which channels for the
# clip with an index of 2.
#
out = cmds.clipSchedule('armScheduler1' ,ci=2, query=True, lp=True)
for pair in out:
   print pair