ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. MEL 例.
headsUpDisplay [-allDescendants] [-allowOverlap boolean] [-attachToRefresh] [-attributeChange string] [-block int] [-blockAlignment string] [-blockSize string] [-command script] [-conditionChange string] [-conditionFalse string] [-conditionTrue string] [-connectionChange string] [-dataAlignment string] [-dataFontSize string] [-dataWidth int] [-decimalPrecision int] [-disregardIndex] [-event string] [-exists] [-getOption string] [-gridColor int] [-label string] [-labelFontSize string] [-labelWidth int] [-lastOccupiedBlock int] [-layoutVisibility boolean] [-listConditions] [-listEvents] [-listHeadsUpDisplays] [-listNodeChanges] [-listPresets] [-name string] [-nextFreeBlock int] [-nodeChanges string] [-padding int] [-preset string] [-refresh] [-remove] [-removeID int] [-removePosition int int] [-resetNodeChanges string] [-scriptResult] [-section int] [-setOption string string] [-showGrid] [-visible boolean] [string]
headsUpDisplay は、取り消し不可能、照会可能、および編集可能です。
このコマンドは、3D ビューポート上の非アクティブ 2D オーバーレイ プレーンに配置されるヘッドアップ ディスプレイ(HUD)オブジェクトを作成します。ユーザ スクリプトで指定する、実際的な情報を提供するために使用します。ビューポートに表示されるテキスト文字列は、このコマンドの各種フラグを使用してフォーマットします。 作成時に必要なフラグは、section フラグと block フラグのみです。preset フラグ、または command フラグ/trigger フラグが存在しない場合、ラベルのみがビューポートに描画されます。 HUD オブジェクトの作成時に、ID 番号が割り当てられます。必要に応じて、この ID 番号を使用して HUD オブジェクト(-rid/removeID [int IDNumber])を除去することができます。また HUD オブジェクトは、それらの位置(セクションとブロック)またはそれの固有の名前を使用して除去することもできます。| int | 定期的なコマンド実行のための、ヘッドアップ ディスプレイ(HUD)の ID 番号 |
| string|int|int[2] | 対応する除去コマンドのヘッドアップ ディスプレイの名前、ID またはセクション、ブロック値。 |
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
|---|---|---|---|---|
-allDescendants(-ad)
|
|
|
||
|
||||
-allowOverlap(-ao)
|
boolean
|
|
||
|
||||
-attachToRefresh(-atr)
|
|
|
||
|
||||
-attributeChange(-ac)
|
string
|
|
||
|
||||
-block(-b)
|
int
|
|
||
|
||||
-blockAlignment(-ba)
|
string
|
|
||
|
||||
-blockSize(-bs)
|
string
|
|
||
|
||||
-command(-c)
|
script
|
|
||
|
||||
-conditionChange(-cc)
|
string
|
|
||
|
||||
-conditionFalse(-cf)
|
string
|
|
||
|
||||
-conditionTrue(-ct)
|
string
|
|
||
|
||||
-connectionChange(-con)
|
string
|
|
||
|
||||
-dataAlignment(-da)
|
string
|
|
||
|
||||
-dataFontSize(-dfs)
|
string
|
|
||
|
||||
-dataWidth(-dw)
|
int
|
|
||
|
||||
-decimalPrecision(-dp)
|
int
|
|
||
|
||||
-disregardIndex(-di)
|
|
|
||
|
||||
-event(-ev)
|
string
|
|
||
|
||||
-exists(-ex)
|
|
|
||
|
||||
-getOption(-op)
|
string
|
|
||
|
||||
-gridColor(-gco)
|
int
|
|
||
|
||||
-label(-l)
|
string
|
|
||
|
||||
-labelFontSize(-lfs)
|
string
|
|
||
|
||||
-labelWidth(-lw)
|
int
|
|
||
|
||||
-lastOccupiedBlock(-lob)
|
int
|
|
||
|
||||
-layoutVisibility(-lv)
|
boolean
|
|
||
|
||||
-listConditions(-lc)
|
|
|
||
|
||||
-listEvents(-le)
|
|
|
||
|
||||
-listHeadsUpDisplays(-lh)
|
|
|
||
|
||||
-listNodeChanges(-lnc)
|
|
|
||
|
||||
-listPresets(-lp)
|
|
|
||
|
||||
-name(-n)
|
string
|
|
||
|
||||
-nextFreeBlock(-nfb)
|
int
|
|
||
|
||||
-nodeChanges(-nc)
|
string
|
|
||
|
||||
-padding(-p)
|
int
|
|
||
|
||||
-preset(-pre)
|
string
|
|
||
|
||||
-refresh(-r)
|
|
|
||
|
||||
-remove(-rem)
|
|
|
||
|
||||
-removeID(-rid)
|
int
|
|
||
|
||||
-removePosition(-rp)
|
int int
|
|
||
|
||||
-resetNodeChanges(-rnc)
|
string
|
|
||
|
||||
-scriptResult(-sr)
|
|
|
||
|
||||
-section(-s)
|
int
|
|
||
|
||||
-setOption(-so)
|
string string
|
|
||
|
||||
-showGrid(-sg)
|
|
|
||
|
||||
-visible(-vis)
|
boolean
|
|
||
|
||||
//
//Define a procedure that returns a value to be used by the Heads Up Display
//
global proc float[] objectPosition ()
{
string $selectedNodes[] = `selectedNodes`;
float $position[3];
if (size($selectedNodes) > 0)
{
string $mainObject = $selectedNodes[ (size($selectedNodes) - 1) ];
$position[0] = `getAttr $mainObject.translateX`;
$position[1] = `getAttr $mainObject.translateY`;
$position[2] = `getAttr $mainObject.translateZ`;
}
else
{
$position[0] = 0;
$position[1] = 0;
$position[2] = 0;
}
return $position;
}
//
//Now, create a HUD object to display the return value of the above procedure
//
//Attributes:
//
// - Section 1, block 0, represents the top second slot of the view.
// - Set the blockSize to "medium", instead of the default "small"
// - Assigned the HUD the label: "Position"
// - Defined the label font size to be large
// - Assigned the HUD a command to run on a SelectionChanged trigger
// - Attached the attributeChange node change to the SelectionChanged trigger
// to allow the update of the data on attribute changes.
//
headsUpDisplay -section 1
-block 0
-blockSize "medium"
-label "Position"
-labelFontSize "large"
-command "objectPosition()"
-event "SelectionChanged"
-nodeChanges "attributeChange"
HUDObjectPosition;
//
//Result: 1//
//
//
//Create a preset HUD object to display the camera names.
//
//Attributes:
//
// - Section 2, block 0, represents the top middle slot of the view.
// - Using blockalign, the HUD object is centered in the middle of the block
// - Setting a dw of 50, allocates a space of 50 pixels for the data to reside in.
// - Finally setting the preset to "cameraNames", selects a preset which will
// automatically insert the associated data into the data field.
//
headsUpDisplay -s 2
-b 0
-ba "center"
-dw 50
-pre "cameraNames"
HUDCameraName;
//
//Result: 2//
//
//
//Now, remove these two HUDs. Both can be removed in three ways: name, ID or position.
//The following examples will demonstrate removal by name and position
//
headsUpDisplay -rem HUDObjectPosition;
//
//Result: 1//
//
headsUpDisplay -rp 7 0;
//
//Result: 7 0//
//