移動先: 概要 戻り値 フラグ. MEL 例.
objectCenter [-global] [-local] [-x] [-y] [-z]
object
objectCenter は 「元に戻す」が可能、「照会」が不可能、「編集」が不可能 です。
このコマンドは、指定したオブジェクトのバウンディング ボックスの中心の座標を返します。1 つの座標だけを指定した場合、浮動小数点数として返します。座標がまったく指定されていない場合、x、y、z を含む浮動小数点数の配列が返されます。複数の座標を指定した場合、1 つだけが返されます。
float[] | 中心を求められた場合(デフォルト)。 |
float | 1 つの座標だけが指定した場合。 |
global, local, x, y, z
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: 1 つのコマンドで複数回使用可能なフラグ
|
// 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 //