ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. Python 例.
headsUpDisplay([string], [allDescendants=boolean], [allowOverlap=boolean], [attachToRefresh=boolean], [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=boolean], [event=string], [exists=boolean], [getOption=string], [gridColor=int], [label=string], [labelFontSize=string], [labelWidth=int], [lastOccupiedBlock=int], [layoutVisibility=boolean], [listConditions=boolean], [listEvents=boolean], [listHeadsUpDisplays=boolean], [listNodeChanges=boolean], [listPresets=boolean], [name=string], [nextFreeBlock=int], [nodeChanges=string], [padding=int], [preset=string], [refresh=boolean], [remove=boolean], [removeID=int], [removePosition=[int, int]], [resetNodeChanges=string], [scriptResult=boolean], [section=int], [setOption=[string, string]], [showGrid=boolean], [visible=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
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)
|
boolean
|
![]() ![]() |
||
|
||||
allowOverlap(ao)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
attachToRefresh(atr)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
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)
|
boolean
|
![]() ![]() |
||
|
||||
event(ev)
|
string
|
![]() ![]() |
||
|
||||
exists(ex)
|
boolean
|
![]() ![]() |
||
|
||||
getOption(op)
|
string
|
![]() |
||
|
||||
gridColor(gco)
|
int
|
![]() ![]() ![]() |
||
|
||||
label(l)
|
string
|
![]() ![]() ![]() |
||
|
||||
labelFontSize(lfs)
|
string
|
![]() ![]() ![]() |
||
|
||||
labelWidth(lw)
|
int
|
![]() ![]() ![]() |
||
|
||||
lastOccupiedBlock(lob)
|
int
|
![]() |
||
|
||||
layoutVisibility(lv)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
listConditions(lc)
|
boolean
|
![]() ![]() |
||
|
||||
listEvents(le)
|
boolean
|
![]() ![]() |
||
|
||||
listHeadsUpDisplays(lh)
|
boolean
|
![]() ![]() |
||
|
||||
listNodeChanges(lnc)
|
boolean
|
![]() ![]() |
||
|
||||
listPresets(lp)
|
boolean
|
![]() ![]() |
||
|
||||
name(n)
|
string
|
![]() |
||
|
||||
nextFreeBlock(nfb)
|
int
|
![]() |
||
|
||||
nodeChanges(nc)
|
string
|
![]() ![]() ![]() ![]() |
||
|
||||
padding(p)
|
int
|
![]() ![]() ![]() |
||
|
||||
preset(pre)
|
string
|
![]() ![]() ![]() |
||
|
||||
refresh(r)
|
boolean
|
![]() |
||
|
||||
remove(rem)
|
boolean
|
![]() ![]() |
||
|
||||
removeID(rid)
|
int
|
![]() ![]() |
||
|
||||
removePosition(rp)
|
[int, int]
|
![]() ![]() |
||
|
||||
resetNodeChanges(rnc)
|
string
|
![]() ![]() |
||
|
||||
scriptResult(sr)
|
boolean
|
![]() |
||
|
||||
section(s)
|
int
|
![]() ![]() ![]() |
||
|
||||
setOption(so)
|
[string, string]
|
![]() |
||
|
||||
showGrid(sg)
|
boolean
|
![]() ![]() ![]() |
||
|
||||
visible(vis)
|
boolean
|
![]() ![]() ![]() |
||
|
![]() |
![]() |
![]() |
![]() |
import maya.cmds as cmds # #Define a procedure that returns a value to be used by the Heads Up Display # def objectPosition(*args): try: selectedNodes = cmds.selectedNodes() mainObj = selectedNodes[-1] positionList = cmds.getAttr('%s.translate' % mainObj) return positionList[0] except: return (0.0,0.0,0.0) # #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. # cmds.headsUpDisplay( 'HUDObjectPosition', section=1, block=0, blockSize='medium', label='Position', labelFontSize='large', command=objectPosition, event='SelectionChanged', nodeChanges='attributeChange' ) # #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. # cmds.headsUpDisplay( 'HUDCameraName', s=2, b=0, ba='center', dw=50, pre='cameraNames') # #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 # cmds.headsUpDisplay( 'HUDObjectPosition', rem=True ) cmds.headsUpDisplay( rp=(7, 0) )