移動先: 概要 戻り値 キーワード. 関連項目. フラグ. Python 例.
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], [rotationsAbsolute=boolean], [scheduleClip=boolean], [sourceClipName=boolean], [split=time], [startTime=time], [useChannel=string])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
clip は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
このコマンドを使用して、キャラクタ クリップを作成、編集、照会します。
戻り値の型は照会モードでは照会フラグが基になります。
character, clip, animation
bakeClip, character, characterMap, characterOutlineEditor, clipEditor, clipSchedule, pose
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, rotationsAbsolute, scheduleClip, sourceClipName, split, startTime, useChannel
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
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 )