ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.
snapKey(
animatedObject
, [animation=string], [attribute=string], [controlPoints=boolean], [float=floatrange], [hierarchy=string], [includeUpperBound=boolean], [index=uint], [shape=boolean], [time=timerange], [timeMultiple=float], [valueMultiple=float])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
snapKey は、取り消し可能、照会不可能、および編集不可能です。
このコマンドは、キーセット上に作用します。キーセットは、1 つまたは複数のアニメーション カーブ上の指定したタイム レンジ内のキー グループとして定義されます。キーセットを構成するアニメーション カーブは、「-animation」フラグの値に依存します。
-animation フラグを使用して、「translateX」など attributeName という形式の引数を取る、多目的な -attribute フラグによって固有に識別されるカーブをオーバーライドすることができます。
アニメーション カーブ上の各キーは、カーブの時間値またはインデックスによって識別されます。時間とインデックスは、単独にあるいはリストの一部または範囲として指定することができます。
このコマンドは、すべてのターゲット キーの時間および/または値を、指定したフラグ引数の倍数の時間および/または値に「スナップ」します。どちらの倍数も指定されていない場合は、既定で 1.0 の倍数の時間にスナップされます。隣接する他のキーを超えてキーを移動すると、このコマンドは失敗することに注意してください。snapKey 操作を実行しても、キーのインデックスは変更されません。
TbaseKeySetCmd.h
int | 時間スナップの不整合によってスナップされなかったキーを持つアニメーション カーブの数です。 |
ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
---|---|---|---|---|
animation(an)
|
string
|
![]() |
||
|
||||
attribute(at)
|
string
|
![]() ![]() |
||
|
||||
controlPoints(cp)
|
boolean
|
![]() |
||
|
||||
float(f)
|
floatrange
|
![]() ![]() |
||
|
||||
hierarchy(hi)
|
string
|
![]() |
||
|
||||
includeUpperBound(iub)
|
boolean
|
![]() |
||
|
||||
index(index)
|
uint
|
![]() ![]() |
||
|
||||
shape(s)
|
boolean
|
![]() |
||
|
||||
time(t)
|
timerange
|
![]() ![]() |
||
|
||||
timeMultiple(tm)
|
float
|
![]() |
||
|
||||
valueMultiple(vm)
|
float
|
![]() |
||
|
![]() |
![]() |
![]() |
![]() |
import maya.cmds as cmds # Two ways to snap all keys on nurbsSphere1 to integer values. # cmds.snapKey( 'nurbsSphere1', tm=1.0 ) cmds.snapKey( 'nurbsSphere1' ) # Snap active objects' keys between times 10 and 20 so that # they have times that are multiples of 0.5. # cmds.snapKey( t=(10,20), tm=0.5 ) # Snap active objects' keys between times 10 and 20 so that # they have times that are multiples of 0.5 and values that # are multiples of 1.0. # cmds.snapKey( t=(10,20), tm=0.5, vm=1.0 )