ジャンプ先: 概要. 戻り値. 関連項目. フラグ. Python 例.

概要

aimConstraint( [target...] object , [aimVector=[float, float, float]], [layer=string], [maintainOffset=boolean], [name=string], [offset=[float, float, float]], [remove=boolean], [skip=string], [targetList=boolean], [upVector=[float, float, float]], [weight=float], [weightAliasList=boolean], [worldUpObject=name], [worldUpType=string], [worldUpVector=[float, float, float]])

注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。

aimConstraint は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。

オブジェクトの方向がターゲット オブジェクト、または複数のターゲットの平均位置を指すようにコンストレインします。 aimConstraint は、入力として、単一の「コンストレイン オブジェクト」の DAGトランスフォームを指す、1 つまたは複数の「ターゲット」の DAGトランスフォームを取ります。オブジェクトのローカル座標系の aimVector がワールド空間位置のターゲット オブジェクトの加重平均を指すように、aimConstraint はコンストレインされたオブジェクトを方向付けます。オブジェクトのローカル座標系のアップ ベクトルは、 ワールド空間で worldUpVector にアラインされます。

戻り値

string[] 作成されたコンストレイン ノード名

戻り値の型は照会モードでは照会フラグが基になります。

関連項目

geometryConstraint, normalConstraint, orientConstraint, parentConstraint, pointConstraint, poleVectorConstraint, scaleConstraint, tangentConstraint

フラグ

aimVector, layer, maintainOffset, name, offset, remove, skip, targetList, upVector, weight, weightAliasList, worldUpObject, worldUpType, worldUpVector
ロング ネーム(ショート ネーム) 引数型 プロパティ
name(n) string createqueryedit
コンストレイン ノードの名前を指定した名前に設定します。デフォルト名は constrainedObjectName_constraintType です。
weight(w) float createqueryedit
指定したターゲットのウェイト値を設定します。 作成時に指定していない場合は、デフォルト値の 1.0 が使用されます。
remove(rm) boolean edit
リストされたターゲットをコンストレインから削除します。
targetList(tl) boolean query
ターゲット オブジェクトのリストを返します。
weightAliasList(wal) boolean query
ターゲット オブジェクトのウェイトをコントロールする、アトリビュートの名前を返します。targetList フラグで返されるターゲットと同じ順序で、エイリアスを返します。
layer(l) string createedit
コンストレインを追加するアニメーション レイヤの名前を指定します。
aimVector(aim) [float, float, float] createqueryedit
エイム ベクトルを設定します。ターゲットを示すローカル座標でのベクトルです。作成時に指定していない場合、デフォルト値の(0.0, 1.0, 0.0)が使用されます。
upVector(u) [float, float, float] createqueryedit
ローカル アップ ベクトルを設定します。これは、ワールド アップ ベクトルとアラインするローカル座標内でのベクトルです。作成時に指定していない場合、デフォルト値の(1.0, 0.0, 0.0)が使用されます。
worldUpVector(wu) [float, float, float] createqueryedit
ワールド アップ ベクトルを設定します。これは、アップ ベクトルとアラインする必要のあるワールド座標内のベクトルです。 詳細については、-wut/worldUpType(下記)を参照してください。 作成時に指定していない場合、デフォルト値の(1.0, 0.0, 0.0)が使用されます。
worldUpObject(wuo) name createqueryedit
DAG オブジェクトを worldUpType "object" および「objectrotation」で使用するように設定します。詳細については、worldUpType を参照してください。 デフォルト値は、ワールド空間座標として解釈される非アップ オブジェクトです。
worldUpType(wut) string createqueryedit
ワールド アップ ベクトル計算のタイプを設定します。 worldUpType は、「scene」、「object」、「objectrotation」、「vector」、または「none」です。 「scene」の場合、upVector はシーンのアップ軸にアラインされ、worldUpVector および worldUpObject は無視されます。 「object」の場合、upVector は worldUpObject の空間の原点にできるだけ近い位置に配置され、worldUpVector は無視されます。 「objectrotation」の場合、worldUpVector は worldUpObject の座標空間にあるものと解釈され、ワールド空間にトランスフォームされて upVector はその結果にできるだけ近くアラインされます。 「vector」の場合、upVector は worldUpVector にできるだけ近くアラインされ、worldUpMatrix は無視されます。 最後に「none」の場合は、コンストレインでツイストの計算は実行されません。その結果、 「upVector」の方向はコンストレインされたオブジェクトの以前の方向に基づくようになり、 「great circle」回転には、エイム ベクトルをそのコンストレインとアラインすることが必要になります。 デフォルトの worldUpType は「vector」です。
offset(o) [float, float, float] createqueryedit
オフセットの値を設定または照会します。デフォルトは 0,0,0 です。
maintainOffset(mo) boolean create
コンストレインされたオブジェクトの初期回転角度の保持に必要なオフセットを計算し、オフセットとして使用します。
skip(sk) string createeditmultiuse
省略する軸を指定します。有効な値は、「x」、「y」、「z」、「none」です。作成時のデフォルトは「none」です。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : タプルまたはリストとして渡された複数の引数を持てるフラグ

Python 例

import maya.cmds as cmds

# Orients the aim vector of cube1 in it's local coordinate space, to point at cone1.
cmds.aimConstraint( 'cone1', 'cube1' )

# Aims cube2 at the average of the position of cone1 and surf2
cmds.aimConstraint( 'cone1', 'surf2', 'cube2', w=.1 )

# Sets the weight for cone1's effect on cube2 to 10.
cmds.aimConstraint( 'cone1', 'cube2', e=True, w=10.0 )

# Removes surf2 from cube2's aimConstraint.
cmds.aimConstraint( 'surf2', 'cube2', e=True, rm=True )

# Adds surf3 to cube2's aimConstraint with the default weight.
cmds.aimConstraint( 'surf3', 'cube2' )

# Aim constrain the z-axis only of sph2 to sph1
cmds.aimConstraint( 'sph1', 'sph2', skip=["x","y"] )