移動先: 概要 戻り値 フラグ. Python 例.
panelHistory(
[name]
, [back=boolean], [clear=boolean], [defineTemplate=string], [exists=boolean], [forward=boolean], [historyDepth=int], [isEmpty=boolean], [suspend=boolean], [targetPane=string], [useTemplate=string], [wrap=boolean])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
panelHistory は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
パネル ヒストリ オブジェクトが作成されます。特定 paneLayout のオブジェクトが対象となり、その paneLayout 内のビュー構成の変更でヒストリ リストが作成されます。リストでは、前後に移動できます。
string | 作成された panelHistory の名前。 |
戻り値の型は照会モードでは照会フラグが基になります。
back, clear, defineTemplate, exists, forward, historyDepth, isEmpty, suspend, targetPane, useTemplate, wrap
ロング ネーム(ショート ネーム) |
引数型 |
プロパティ |
exists(ex)
|
boolean
|
|
|
指定したオブジェクトが存在するかどうかによって、
true または false を返します。他のフラグは無視されます。
|
|
defineTemplate(dt)
|
string
|
|
|
他の任意のフラグと引数を解析し、かつ引数で指定したコマンド テンプレートに
追加するモードに、コマンドのモードを変更します。
templateName がカレントのテンプレートとして設定されていれば、
その後コマンドが実行されるたびに、この引数がデフォルトの引数として使用されます。
|
|
useTemplate(ut)
|
string
|
|
|
コマンドに、カレント以外のコマンド テンプレートの使用を強制します。
|
|
targetPane(tp)
|
string
|

|
|
ヒストリを維持する paneLayout を指定します。
|
|
back(b)
|
boolean
|
|
|
forward(f)
|
boolean
|
|
|
clear(cl)
|
boolean
|
|
|
historyDepth(hd)
|
int
|

|
|
suspend(s)
|
boolean
|
|
|
パネル ヒストリの更新を停止するか再開するかを指定します。
多数の変更を 1 つのヒストリ イベントにまとめる場合に便利です。
|
|
wrap(w)
|
boolean
|

|
|
ヒストリを末尾と先頭で折り返すかどうかを指定します。この値はデフォルトで true になっています。
|
|
isEmpty(ie)
|
boolean
|
|
|
パネル ヒストリが現在存在しない場合に true を返します。
|
|
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
# Create a window containing a pane layout. The window also contains
# an option menu for changing the layout configuration and two buttons
# for stepping through the configuration history.
#
window = cmds.window( title='panelHistory Example' )
form = cmds.formLayout()
# Create the option menu for panel configuration.
#
configuration = cmds.optionMenuGrp( label='Configuration', columnWidth2=( 100, 150 ) )
single = cmds.menuItem( label='Single' )
stacked = cmds.menuItem( label='2 Stacked' )
sideBySide = cmds.menuItem( label='2 Side by Side' )
four = cmds.menuItem( label='Four' )
# Create the buttons for stepping through configuration history.
#
history = cmds.rowLayout( numberOfColumns=3 , columnWidth3=( 100, 75, 75 ),
columnAttach=[( 2, 'both', 0 ),( 3, 'both', 0 )] )
cmds.text( label='History' )
backBtn = cmds.button( label='Back' )
forwardBtn = cmds.button( label='Forward' )
cmds.setParent( '..' )
# Create the pane layout.
#
frame = cmds.frameLayout( labelVisible=False )
panes = cmds.paneLayout()
cmds.text( label='Pane 1' )
cmds.text( label='Pane 2' )
cmds.text( label='Pane 3' )
cmds.text( label='Pane 4' )
# Set up the attachments.
#
cmds.formLayout( form, edit=True,
attachForm=[(configuration, 'top', 5),
(configuration, 'left', 5),
(history, 'left', 5),
(history, 'right', 5),
(frame, 'left', 5),
(frame, 'right', 5),
(frame, 'bottom', 5)],
attachControl=[(history, 'top', 5, configuration),
(frame, 'top', 5, history)] )
# Create the panel history object.
#
panelHistory = cmds.panelHistory(targetPane=panes)
# Attach a command to the option menu to change the panel layout
# configuration accordingly.
#
cmds.optionMenuGrp( configuration,
edit=True,
changeCommand=('ExampleUpdatePaneLayout( \"'+ configuration + '\", \"' + panes + '\" )') )
# Attach commands to the buttons for stepping through the configuration
# history. The commands should also update the value of the option menu.
#
cmds.button( backBtn, edit=True,
command='cmds.panelHistory( panelHistory, edit=True, back=True ); ExampleUpdateConfiguration( \"' + configuration + '\", \"' + panes + '\" )' )
cmds.button( forwardBtn, edit=True,
command='cmds.panelHistory( panelHistory, edit=True, forward=True ); ExampleUpdateConfiguration( \"' + configuration + '\", \"' + panes + '\" )' )
cmds.showWindow( window )
# Call this procedure whenever the option menu's configuration value
# changes. This procedure will update the configuration of the
# pane layout to reflect the change.
#
def ExampleUpdatePaneLayout( optionMenuGrp, paneLayout ):
if optionMenuGrp == "" or paneLayout == "":
return
value = cmds.optionMenuGrp( optionMenuGrp, query=True, value=True )
if value == "Single":
cmds.paneLayout( paneLayout, edit=True, configuration='single' )
elif value == "2 Stacked":
cmds.paneLayout( paneLayout, edit=True, configuration='horizontal2' )
elif value == "2 Side by Side":
cmds.paneLayout( paneLayout, edit=True, configuration='vertical2' )
elif value == "Four":
cmds.paneLayout( paneLayout, edit=True, configuration='quad' )
# Call this procedure whenever the panel configuration changes due to
# stepping through the panel history (ie. pressing either the "Forward"
# or "Back" buttons. This procedure will update the value of the
# option menu to reflect the new pane layout configuration.
#
def ExampleUpdateConfiguration( optionMenuGrp, paneLayout ):
if optionMenuGrp == "" or paneLayout == "":
return
configuration = cmds.paneLayout( paneLayout, query=True, configuration=True );
if configuration == 'single':
cmds.optionMenuGrp( optionMenuGrp, edit=True, value='Single' )
elif configuration == 'horizontal2':
cmds.optionMenuGrp( optionMenuGrp, edit=True, value='2 Stacked' )
elif configuration == 'vertical2':
cmds.optionMenuGrp( optionMenuGrp, edit=True, value='2 Side by Side' )
elif configuration == 'quad':
cmds.optionMenuGrp( optionMenuGrp, edit=True, value='Four' )