移動先: 概要 戻り値 フラグ. Python 例.
windowPref(
string
, [exists=boolean], [height=int], [leftEdge=int], [loadAll=boolean], [parentMain=boolean], [remove=boolean], [removeAll=boolean], [saveAll=boolean], [topEdge=int], [topLeftCorner=[int, int]], [width=int], [widthHeight=[int, int]])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
windowPref は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
ウィンドウのアトリビュートを生成、修正します。ウィンドウのサイズや位置は、アプリケーションのセッションが変わっても維持されます。デフォルトのウィンドウ プリファレンスは、ウィンドウを閉じたときに作成されます。ウィンドウのプリファレンスを指定する必要があります。したがって、その名前に一致するウィンドウにしか影響を及ぼしません。
ウィンドウのプリファレンスは、Maya メイン ウィンドウにも、コマンド ウィンドウにも適用されないことに注意してください。
なし
戻り値の型は照会モードでは照会フラグが基になります。
exists, height, leftEdge, loadAll, parentMain, remove, removeAll, saveAll, topEdge, topLeftCorner, width, widthHeight
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
# Check if the window exists.
#
if cmds.window('ExampleWindow', exists=True):
cmds.deleteUI('ExampleWindow', window=True)
# Create a window.
#
cmds.window( 'ExampleWindow' )
cmds.columnLayout()
cmds.text( label='Size and position the window before closing it.' )
cmds.button( label='Close', command='cmds.deleteUI("ExampleWindow", window=True)' )
cmds.showWindow( 'ExampleWindow' )
# When the window is closed a window preference object is
# created for the window. It has the same name as the window
# object.
#
cmds.windowPref( 'ExampleWindow', exists=True )
# Query the window preference size and position.
#
cmds.windowPref( 'ExampleWindow', query=True, topLeftCorner=True )
cmds.windowPref( 'ExampleWindow', query=True, widthHeight=True )
# Create a window with the same name. When it is shown
# it will be sized and positioned according to the
# window preference.
#
if cmds.window('ExampleWindow', exists=True):
cmds.deleteUI('ExampleWindow', window=True)
cmds.window( 'ExampleWindow' )
cmds.columnLayout()
cmds.text( label='Size and position the window before closing it.' )
cmds.button( label='Close', command='cmds.deleteUI("ExampleWindow", window=True)' )
cmds.showWindow( 'ExampleWindow' )
# Delete the window preference and the window will have a
# default size and position.
#
cmds.windowPref( 'ExampleWindow', remove=True )
# Create the window one last time.
#
if cmds.window('ExampleWindow', exists=True):
cmds.deleteUI('ExampleWindow', window=True)
cmds.window( 'ExampleWindow' )
cmds.columnLayout()
cmds.text( label='Size and position the window before closing it.' )
cmds.button( label='Close', command='cmds.deleteUI("ExampleWindow", window=True)' )
cmds.showWindow( 'ExampleWindow' )