ジャンプ先: 概要. 戻り値. フラグ. Python 例.
workspaceControlState(
string
, [defaultTopLeftCorner=[int, int]], [defaultWidthHeight=[int, int]], [exists=boolean], [height=int], [leftEdge=int], [maximized=boolean], [remove=boolean], [topEdge=int], [topLeftCorner=[int, int]], [width=int], [widthHeight=[int, int]])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
workspaceControlState は、取り消し可能、照会可能、および編集可能です。
ワークスペース コントロールの希望するウィンドウ アトリビュートを作成または修正します。ワークスペース コントロールのサイズや位置は、アプリケーション セッション中は保持されます(ただし、位置はフローティング ワークスペース ドッキング パネルに単独で存在するワークスペース コントロールのみに適用されます)。ワークスペース コントロールを閉じると、既定のワークスペース コントロールの状態が作成されます。ワークスペース コントロールの状態に名前を付ける必要があり、その後は一致する名前を持つワークスペース コントロールのみに影響します。
なし
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
defaultTopLeftCorner, defaultWidthHeight, exists, height, leftEdge, maximized, remove, 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.workspaceControlState( 'ExampleWindow', exists=True )
# Query the window preference size and position.
#
cmds.workspaceControlState( 'ExampleWindow', query=True, topLeftCorner=True )
cmds.workspaceControlState( '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.workspaceControlState( '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' )