ジャンプ先: 概要. 戻り値. フラグ. Python 例.
dimWhen(
string string
, [clear=boolean], [false=boolean], [true=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
dimWhen は、取り消し可能、照会不可能、および編集不可能です。
このメソッドは、指定した UI オブジェクト(1 番目の引数)を、指定した条件(2 番目の引数)にアタッチして、条件が特定の状態になったときにオブジェクトが暗くなるようにします。 オブジェクトが存在しない場合はエラーになります。条件は存在しなくても問題ありません。その条件が存在するようになるまでは、プレースホルダが使用されます。 UI オブジェクトは、コントロールまたはメニュー項目のどちらかである必要があります。なし
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
|---|---|---|---|---|
false(f)
|
boolean
|
|
||
|
||||
true(t)
|
boolean
|
|
||
|
||||
clear(c)
|
boolean
|
|
||
|
||||
import maya.cmds as cmds # Create a window with a menu item and button that will dim if # there are no objects selected in the scene. # window = cmds.window(menuBar=True, title='dimWhen Example') cmds.menu( label='Edit' ) menuItem = cmds.menuItem(label='Delete Selection', command='cmds.delete()') cmds.columnLayout(adjustableColumn=True) button = cmds.button(label='Delete Selection', command='cmds.delete()') # Create a few buttons to create some objects, select all the objects in # the scene, and clear the selection. # cmds.button(label='Create Objects', command='cmds.sphere(); cmds.cone(); cmds.cylinder();') cmds.button(label='Select All', command='cmds.select(all=True)') cmds.button(label='Select Nothing', command='cmds.select(clear=True)') # Add the dim conditions. # cmds.dimWhen( 'SomethingSelected', button, false=True ) cmds.dimWhen( 'SomethingSelected', menuItem, false=True ) cmds.showWindow( window )