ジャンプ先: 概要. 戻り値. フラグ. MEL 例.
objectCenter [-global] [-local] [-x] [-y] [-z]
object
objectCenter は、取り消し可能、照会不可能、および編集不可能です。
このコマンドは、指定したオブジェクトのバウンディング ボックスの中心の座標を返します。1 つの座標だけを指定した場合、浮動小数点数として返します。座標がまったく指定されていない場合、x、y、z を含む浮動小数点数の配列が返されます。複数の座標を指定した場合、1 つだけが返されます。
float[] | 中心を求められた場合(既定)。 |
float | 1 つの座標だけが指定した場合。 |
global, local, x, y, z
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
コマンド内でフラグを複数回使用できます。
|
// create a simple hierarchy
polyCube -name "a";
polyCube -name "b";
parent b a;
move -localSpace 3 0 0 a;
move -localSpace 2 2 2 b;
// Get the world space x coordinate value of object b's center
float $X_COORD = `objectCenter -x b`;
// Result: 5 //
// Get the center of the bounding box of b in local space
float $XYZ[] = `objectCenter -l b`;
// Result: 2 2 2 //
// Get the center of the bounding box of b in world space
float $XYZ[] = `objectCenter -gl b`;
// Result: 5 2 2 //
// Get the center of the bounding box of a in world space
float $XYZ[] = `objectCenter -gl a`;
// Result: 4 1 1 //