ジャンプ先: 概要. 注. 戻り値. 関連. フラグ. Python 例.
xform(
[objects...]
, [absolute=boolean], [boundingBox=boolean], [boundingBoxInvisible=boolean], [centerPivots=boolean], [centerPivotsOnComponents=boolean], [deletePriorHistory=boolean], [euler=boolean], [matrix=[float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float]], [objectSpace=boolean], [parentSpace=boolean], [pivots=[linear, linear, linear]], [preserve=boolean], [preserveUV=boolean], [reflection=boolean], [reflectionAboutBBox=boolean], [reflectionAboutOrigin=boolean], [reflectionAboutX=boolean], [reflectionAboutY=boolean], [reflectionAboutZ=boolean], [reflectionTolerance=float], [relative=boolean], [rotateAxis=[angle, angle, angle]], [rotateOrder=string], [rotatePivot=[linear, linear, linear]], [rotateTranslation=[linear, linear, linear]], [rotation=[angle, angle, angle]], [scale=[float, float, float]], [scalePivot=[linear, linear, linear]], [scaleTranslation=[linear, linear, linear]], [shear=[float, float, float]], [translation=[linear, linear, linear]], [worldSpace=boolean], [worldSpaceDistance=boolean], [zeroTransformPivots=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
xform は、取り消し可能、照会可能、および編集不可能です。
このコマンドは、変換ノードにおける、あらゆる要素の照会/設定に使用できます。また、変換行列やバウンディング ボックスのような、直接設定できない値を照会することもできます。ピボット ポイントを設定することもできます。
すべての値は、変換の座標(アトリビュート - スペース)で指定します。
さらに、アトリビュートはフラグ セクションに表示される順序で適用されるか、返されます(この順序は、次に示す変換行列に表示される順序に対応します)。
関連トピック 移動、回転、スケール
ノードに対する変換行列は、指定した順序で次の行列を後で掛け合わせて作成されます(注: 回転は回転順序パラメータに従って適用されます。以下にはこの 6 種類の回転は示されていません)
// -1 -1
//[M] = [sp]x[s]x[sh]x[sp]x[st]x[rp]x[ar]x[ro]x[rp]x[rt]x[t]
//
//where:
//
//[sp] = | 1 0 0 0 | = scale pivot matrix
// | 0 1 0 0 |
// | 0 0 1 0 |
// | -spx -spy -spz 1 |
//
//[s] = | sx 0 0 0 | = scale matrix
// | 0 sy 0 0 |
// | 0 0 sz 0 |
// | 0 0 0 1 |
//
//
//[sh] = | 1 0 0 0 | = shear matrix
// | xy 1 0 0 |
// | xz yz 1 0 |
// | 0 0 0 1 |
//
// -1
//[sp] = | 1 0 0 0 | = scale pivot inverse matrix
// | 0 1 0 0 |
// | 0 0 1 0 |
// | spx spy spz 1 |
//
//[st] = | 1 0 0 0 | = scale translate matrix
// | 0 1 0 0 |
// | 0 0 1 0 |
// | stx sty stz 1 |
//
//[rp] = | 1 0 0 0 | = rotate pivot matrix
// | 0 1 0 0 |
// | 0 0 1 0 |
// | -rpx -rpy -rpz 1 |
//
//[ar] = | * * * 0 | = axis rotation matrix
// | * * * 0 | (composite rotation,
// | * * * 0 | see [rx], [ry], [rz]
// | 0 0 0 1 | below for details)
//
//[rx] = | 1 0 0 0 | = rotate X matrix
// | 0 cos(x) sin(x) 0 |
// | 0 -sin(x) cos(x) 0 |
// | 0 0 0 1 |
//
//[ry] = | cos(y) 0 -sin(y) 0 | = rotate Y matrix
// | 0 1 0 0 |
// | sin(y) 0 cos(y) 0 |
// | 0 0 0 1 |
//
//[rz] = | cos(z) sin(z) 0 0 | = rotate Z matrix
// | -sin(z) cos(z) 0 0 |
// | 0 0 1 0 |
// | 0 0 0 1 |
//
// -1
//[rp] = | 1 0 0 0 | = rotate pivot matrix
// | 0 1 0 0 |
// | 0 0 1 0 |
// | rpx rpy rpz 1 |
//
//[rt] = | 1 0 0 0 | = rotate translate matrix
// | 0 1 0 0 |
// | 0 0 1 0 |
// | rtx rty rtz 1 |
//
//[t] = | 1 0 0 0 | = translation matrix
// | 0 1 0 0 |
// | 0 0 1 0 |
// | tx ty tz 1 |
なし
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
move, rotate, scale
absolute, boundingBox, boundingBoxInvisible, centerPivots, centerPivotsOnComponents, deletePriorHistory, euler, matrix, objectSpace, parentSpace, pivots, preserve, preserveUV, reflection, reflectionAboutBBox, reflectionAboutOrigin, reflectionAboutX, reflectionAboutY, reflectionAboutZ, reflectionTolerance, relative, rotateAxis, rotateOrder, rotatePivot, rotateTranslation, rotation, scale, scalePivot, scaleTranslation, shear, translation, worldSpace, worldSpaceDistance, zeroTransformPivots
ロング ネーム(ショート ネーム) |
引数タイプ |
プロパティ |
|
absolute(a)
|
boolean
|
|
|
boundingBox(bb)
|
boolean
|
|
|
オブジェクトのバウンディング ボックスを返します。戻り値は次の順序で戻されます: x の最小値、y の最小値、z の最小値、x の最大値、y の最大値、z の最大値
|
|
boundingBoxInvisible(bbi)
|
boolean
|
|
|
オブジェクトのバウンディング ボックスを返します。boundingBox フラグを使用した場合は、含まれないすべての非表示の子のバウンディング ボックスも含まれます。戻り値は次の順序で返されます。x の最小値、y の最小値、z の最小値、x の最大値、y の最大値、z の最大値
|
|
centerPivots(cp)
|
boolean
|
|
|
ピボット ポイントを、オブジェクトのバウンディング ボックスの中心に設定します(-p フラグを参照)
|
|
centerPivotsOnComponents(cpc)
|
boolean
|
|
|
ピボット ポイントを、コンポーネントのバウンディング ボックスの中心に設定します(-p フラグを参照)
|
|
deletePriorHistory(dph)
|
boolean
|
|
|
true の場合、操作が実行される前にコンストラクション ヒストリが削除されます。
|
|
euler(eu)
|
boolean
|
|
|
回転値を指定する -relative フラグの修飾子で、現在の XYZ 回転値に加算されます。
|
|
matrix(m)
|
[float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float]
|

|
|
コンポジット変換行列を作成するか、返します。*注* 行列は、列順で指定される 16 個の double 型の引数で表されます。
|
|
objectSpace(os)
|
boolean
|

|
|
(ピボット、移動、回転、回転軸、行列、バウンディング ボックス フラグのみに有効な)オブジェクト空間の変換値として値を扱います。
|
|
parentSpace(ps)
|
boolean
|

|
|
(ピボット、移動、回転、回転軸、行列、バウンディング ボックス フラグのみに有効な)親空間の変換値として値を扱います。
|
|
pivots(piv)
|
[linear, linear, linear]
|

|
|
回転ピボットとスケール ピボットを同時に変更する便利な方法です(詳細については、-rp -sp フラグを参照)。
|
|
preserve(p)
|
boolean
|
|
|
全体的な変換を保持します。ピボットまたは回転順序を変更するときにオブジェクトが「ジャンプ」するのを防ぐために使用します。既定値は true です(-sp、-rp、-roo、-cp、-ra と一緒に使用)。
|
|
preserveUV(puv)
|
boolean
|
|
|
true の場合、回転されるコンポーネント上の UV 値は、3D 空間の回転から投影されます。小さな編集では、これによりワールド空間のオブジェクト上のテクスチャ マッピングがフリーズします。false の場合は、選択した頂点の UV 値は変更されません。既定は false です。
|
|
reflection(rfl)
|
boolean
|
|
|
reflectionAboutBBox(rab)
|
boolean
|
|
|
対称軸の位置をジオメトリのバウンディング ボックスに設定します。
|
|
reflectionAboutOrigin(rao)
|
boolean
|
|
|
reflectionAboutX(rax)
|
boolean
|
|
|
reflectionAboutY(ray)
|
boolean
|
|
|
reflectionAboutZ(raz)
|
boolean
|
|
|
reflectionTolerance(rft)
|
float
|
|
|
対応する対称コンポーネントを見つける許容値を指定します。
|
|
relative(r)
|
boolean
|
|
|
rotateAxis(ra)
|
[angle, angle, angle]
|

|
|
回転軸の方向です(-p フラグとともに使用する場合は、回転全体における、軸回転の補正のために回転に変更が加えられるのを防ぎます)。
|
|
rotateOrder(roo)
|
string
|

|
|
回転の順番です(-p フラグとともに使用する場合は、ローカル回転にオリジナルのものと同等になるよう修正を加え、回転全体を保持します)。このフラグに対する有効な値は <xyz | yzx | zxy | xzy | yxz | zyx> です。
|
|
rotatePivot(rp)
|
[linear, linear, linear]
|

|
|
ピボット ポイントで回転変換します(-p フラグとともに使用する場合は、変換全体の回転変換に変更が加えられるのを防ぎます)。
|
|
rotateTranslation(rt)
|
[linear, linear, linear]
|

|
|
rotation(ro)
|
[angle, angle, angle]
|

|
|
scale(s)
|
[float, float, float]
|

|
|
scalePivot(sp)
|
[linear, linear, linear]
|

|
|
ピボット ポイントでスケール変換します(-p フラグとともに使用する場合は、トランスフォーム全体のスケール変換に変更が加えられるのを防ぎます)。
|
|
scaleTranslation(st)
|
[linear, linear, linear]
|

|
|
shear(sh)
|
[float, float, float]
|

|
|
シア変換します。値はシアの <xy,xz,yz> を表します。
|
|
translation(t)
|
[linear, linear, linear]
|

|
|
worldSpace(ws)
|
boolean
|

|
|
(ピボット、移動、回転、回転軸、行列、バウンディング ボックス フラグに対して有効。)スケールの照会時は、この計算は累積的なものであり、すべてが均等スケールで回転がない場合のみ有効になることに注意してください。不均等スケールと回転のある階層の場合、この値は認識されたグローバル スケールと正確に一致しない場合があります。
|
|
worldSpaceDistance(wd)
|
boolean
|

|
|
-sp、-rp、-st、-rt、-t、-piv フラグの値は、ワールド空間におけるローカル軸に沿った移動距離として扱われます。ローカル軸は、コマンドがローカル空間またはオブジェクト空間で機能しているかどうかによって異なります。このフラグは、ワールド空間では効果がありません。
|
|
zeroTransformPivots(ztp)
|
boolean
|
|
|
移動チャネルにこれらの値を適用することにより、行列全体を変更せずにピボット ポイントとピボットの移動をリセットします。
|
|
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
import maya.cmds as cmds
# create object to manipulate
cmds.sphere( n='sphere1' )
# set rotation of sphere
cmds.xform( r=True, ro=(0, 90, 0) )
# change the rotate order but preserve the overall transformation
cmds.xform( p=True, roo='yzx' )