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

Synopsis

clip([absolute=boolean], [absoluteRotations=boolean], [active=string], [addTrack=boolean], [allAbsolute=boolean], [allClips=boolean], [allRelative=boolean], [allSourceClips=boolean], [animCurveRange=boolean], [character=boolean], [constraint=boolean], [copy=boolean], [defaultAbsolute=boolean], [duplicate=boolean], [endTime=time], [expression=boolean], [ignoreSubcharacters=boolean], [isolate=boolean], [leaveOriginal=boolean], [mapMethod=string], [name=string], [newName=string], [paste=boolean], [pasteInstance=boolean], [remove=boolean], [removeTrack=boolean], [rotationOffset=[float, float, float]], [rotationsAbsolute=boolean], [scheduleClip=boolean], [sourceClipName=boolean], [split=time], [startTime=time], [translationOffset=[float, float, float]], [useChannel=string])

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

clip is undoable, queryable, and editable.

This command is used to create, edit and query character clips.

Return value

string[]clip names

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

Keywords

character, clip, animation

Related

bakeClip, character, characterMap, clipEditor, clipSchedule, pose

Flags

absolute, absoluteRotations, active, addTrack, allAbsolute, allClips, allRelative, allSourceClips, animCurveRange, character, constraint, copy, defaultAbsolute, duplicate, endTime, expression, ignoreSubcharacters, isolate, leaveOriginal, mapMethod, name, newName, paste, pasteInstance, remove, removeTrack, rotationOffset, rotationsAbsolute, scheduleClip, sourceClipName, split, startTime, translationOffset, useChannel
Long name (short name) Argument types Properties
startTime(s) time createqueryedit
Specify the clip start
endTime(end) time createqueryedit
Specify the clip end
name(n) string createquerymultiuse
In create mode, specify the clip name. In query mode, return a list of all the clips. In duplicate mode, specify the clip to be duplicated. In copy mode, specify the clip to be copied. This flag is multi-use, but multiple use is only supported with the copy flag. For use during create and with all other flags, only the first instance of the name flag will be utilized.

In query mode, this flag can accept a value.

newName(nn) string create
Rename a clip. Must be used in conjunction with the clip name flag, which is used to specify the clip to be renamed.
active(a) string queryedit
Query or edit the active clip. This flag is not valid in create mode. Making a clip active causes its animCurves to be hooked directly to the character attributes in addition to being attached to the clip library node. This makes it easier to access the animCurves if you want to edit, delete or add additional animCruves to the clip.
animCurveRange(acr) boolean create
This flag can be used at the time you create the clip instead of the startTime and endTime flags. It specifies that you want the range of the clip to span the range of keys in the clips associated animCurves.
absolute(abs) boolean create
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. Default is true.
absoluteRotations(abr) boolean create
This flag is now deprecated. Use aa/allAbsolute, ar/allRelative, ra/rotationsAbsolute, or da/defaultAbsolute instead. If true, this overrides the -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 create
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 create
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 create
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 create
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.
remove(rm) boolean query
Remove the clip specified by the name flag. The clip will be permanently removed from the library and deleted from any times where it has been scheduled.
duplicate(d) boolean query
Duplicate the clip specified by the name flag. The start time of the new clip should be specified with the startTime flag.
scheduleClip(sc) boolean create
This flag is used when creating a clip to specify whether or not the clip should immediately be scheduled at the current time. If the clip is not scheduled, the clip will be placed in the library for future use, but will not be placed on the timeline. This flag is for use only when creating a new clip or duplicating an existing. The default is true.
leaveOriginal(lo) boolean create
This flag is used when creating a clip to specify that the animation curves should be copied to the clip library, and left on the character.
copy(c) boolean createquery
This flag is used to copy a clip or clips to the clipboard. It should be used in conjunction with the name flag to copy the named clips on the specified character and its subcharacters. In query mode, this flag allows you to query what, if anything, has been copied into the clip clipboard.
paste(p) boolean create
This flag is used to paste a clip or clips from the clipboard to a character. Clips are added to the clipboard using the c/copy flag.
pasteInstance(pi) boolean create
This flag is used to paste an instance of a clip or clips from the clipboard to a character. Unlike the p/paste flag, which duplicates the animCurves from the original source clip, the pi/pasteInstance flag shares the animCurves from the source clip.
split(sp) time createedit
Split an existing clip into two clips. The split occurs around the specified time.
mapMethod(mm) string create
This is is valid with the paste and pasteInstance flags only. It specifies how the mapping should be done. Valid options are: "byNodeName", "byAttrName", "byCharacterMap", "byAttrOrder", "byMapOrAttrName" and "byMapOrNodeName". "byAttrName" is the default. The flags mean the following: "byAttrOrder" maps using the order that the character stores the attributes internally, "byAttrName" uses the attribute name to find a correspondence, "byNodeName" uses the node name *and* the attribute name to find a correspondence, "byCharacterMap" uses the existing characterMap node to do the mapping. "byMapOrAttrName" uses a character map if one exists, otherwise uses the attribute name. "byMapOrNodeName" uses a character map if one exists, otherwise uses the attribute name.
isolate(i) boolean create
This flag should be used in conjunction with the name flag to specify that a clip or clips should be copied to a new clip library. The most common use of this flag is for export, when you want to only export certain clips from the character, without exporting all of the clips.
sourceClipName(scn) boolean query
This flag is for query only. It returns the name of the source clip that controls an instanced clip.
allClips(ac) boolean query
This flag is used to query all the clips in the scene. Nodes of type "animClip" that are storing poses, are not returned by this command.
allSourceClips(asc) boolean query
This flag is used to query all the source clips in the scene. Nodes of type "animClip" that are storing poses or clip instances, are not returned by this command.
addTrack(at) boolean
This flag is now obsolete. Use the insertTrack flag on the clipSchedule command instead.
removeTrack(rt) boolean create
This flag is now obsolete. Use removeTrack flag on the clipSchedule command instead.
useChannel(uc) string createmultiuse
Specify which channels should be acted on. This flag is valid only in conjunction with clip creation, and the isolate flag. The specified channels must be members of the character.
ignoreSubcharacters(ignoreSubcharacters) boolean create
During clip creation, duplication and isolation, subcharacters are included by default. If you want to create a clip on the top level character only, or you want to duplicate the clip on the top level character without including subCharacters, use the ignoreSubcharacters flag.
character(ch) boolean query
This is a query only flag which operates on the specified clip. It returns the names of any characters that a clip is associated with.
constraint(cn) boolean create
This creates a clip out of any constraints on the character. The constraint will be moved off of the character and into the clip, so that it is only active for the duration of the clip, and its value can be scaled/offset/cycled according to the clip attributes.
expression(ex) boolean create
This creates a clip out of any expressions on the character. The expression will be moved off of the character and into the clip, so that it is only active for the duration of the clip, and its value can be scaled/offset/cycled according to the clip attributes.
translationOffset(tof) [float, float, float] createquery
Return the channel offsets used to modify the clip's translation.
rotationOffset(rof) [float, float, float] createquery
Return the channel offsets used to modify the clip's rotation.

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' )
# Create a 2nd animation for the character.
#
cmds.select( 'joint2', r=True )
cmds.currentTime( 0 )
cmds.setKeyframe( 'joint2.rx' )
cmds.setKeyframe( 'joint2.ry', v=20 )
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' )
# Query the existing source clips
#
cmds.clip( 'arm', query=True, n=True )
# Result:[u'handWaveSource', u'elbowWaveSource'] #
# Query the active clip. Note that the default clip is always active unless
# another clip has been specified as active. This means that new keyframes
# always go into the default clip unless you make another clip active.
#
cmds.clip( 'arm', query=True, active=True )
# Result: default #
# Duplicate the clip named "elbowWaveSource" on the character named "arm" and
# place the duplicate in the schedule at a start time of 50
#
cmds.clip( 'arm', duplicate=True, name='elbowWaveSource', s=50 )
# Duplicate the clip named "wiggle" on the character named "arm" and
# do not place the duplicate in the schedule
#
cmds.clip( 'arm', duplicate=True, sc=False, name='wiggle' )
# Remove the clip from the character altogether. All instances of the clip will be
# removed from the schedule and deleted from the library.
#
cmds.clip( 'arm', rm=True, name='elbowWaveSource')
# Make the handWave clip active. This means that any new keyframes get
# placed in the handWave clip, and modifications to existing handWave
# keyframes can be made.
#
cmds.clip( 'arm', edit=True, active='handWave' )
# Split the clip named "handWave" into two clips at time 10
#
cmds.clip( 'arm', split=10, name='handWave' )
# Query the startTime of a clip. This is the start frame of the animation
# curve range of the clip, and may differ from the scheduled time of the clip,
# which is accessed using the clipSchedule command.
#
cmds.clip( 'arm', name='handWave', query=True, s=True )