ジャンプ先: 概要. 戻り値. キーワード. 関連項目. フラグ. 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 またはセクション、ブロック値。 |
戻り値の型は照会モードでは照会フラグが基になります。
| ロング ネーム(ショート ネーム) | 引数型 | プロパティ | ||
|---|---|---|---|---|
-name(-n) |
string |
|||
|
||||
-exists(-ex) |
||||
|
||||
-refresh(-r) |
||||
|
||||
-label(-l) |
string |
|||
|
||||
-layoutVisibility(-lv) |
boolean |
|||
|
||||
-visible(-vis) |
boolean |
|||
|
||||
-allowOverlap(-ao) |
boolean |
|||
|
||||
-section(-s) |
int |
|||
|
||||
-block(-b) |
int |
|||
|
||||
-nextFreeBlock(-nfb) |
int |
|||
|
||||
-lastOccupiedBlock(-lob) |
int |
|||
|
||||
-blockSize(-bs) |
string |
|||
|
||||
-padding(-p) |
int |
|||
|
||||
-blockAlignment(-ba) |
string |
|||
|
||||
-labelFontSize(-lfs) |
string |
|||
|
||||
-dataFontSize(-dfs) |
string |
|||
|
||||
-dataAlignment(-da) |
string |
|||
|
||||
-labelWidth(-lw) |
int |
|||
|
||||
-dataWidth(-dw) |
int |
|||
|
||||
-decimalPrecision(-dp) |
int |
|||
|
||||
-showGrid(-sg) |
||||
|
||||
-gridColor(-gco) |
int |
|||
|
||||
-command(-c) |
script |
|||
|
||||
-nodeChanges(-nc) |
string |
|||
|
||||
-resetNodeChanges(-rnc) |
string |
|||
|
||||
-attachToRefresh(-atr) |
||||
|
||||
-conditionTrue(-ct) |
string |
|||
|
||||
-conditionFalse(-cf) |
string |
|||
|
||||
-conditionChange(-cc) |
string |
|||
|
||||
-event(-ev) |
string |
|||
|
||||
-attributeChange(-ac) |
string |
|||
|
||||
-connectionChange(-con) |
string |
|||
|
||||
-disregardIndex(-di) |
||||
|
||||
-allDescendants(-ad) |
||||
|
||||
-preset(-pre) |
string |
|||
|
||||
-listConditions(-lc) |
||||
|
||||
-listEvents(-le) |
||||
|
||||
-listHeadsUpDisplays(-lh) |
||||
|
||||
-listNodeChanges(-lnc) |
||||
|
||||
-listPresets(-lp) |
||||
|
||||
-scriptResult(-sr) |
||||
|
||||
-remove(-rem) |
||||
|
||||
-removeID(-rid) |
int |
|||
|
||||
-removePosition(-rp) |
int int |
|||
|
||||
-setOption(-so) |
string string |
|||
|
||||
-getOption(-op) |
string |
|||
|
||||
//
//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//
//