renameUI(
string string
)
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
renameUI は 「元に戻す」が可能、「照会」が不可能、「編集」が不可能 です。
このコマンドは、1 番目の引数として渡された UI オブジェクトの名前を、2 番目の引数として指定された新しい名前に変更します。新しい名前が重複しているか有効でない場合、名前の変更は失敗して古い名前が返されます。string | 新しい名前。名前の変更に失敗した場合は古い名前。 |
import maya.cmds as cmds # Create a window with a single button. # window = cmds.window() cmds.columnLayout() cmds.button( 'exampleButton', label='Example' ) cmds.showWindow( window ) # Edit the button label. # cmds.button( 'exampleButton', edit=True, label='New Label' ) # Rename the button. # cmds.renameUI( 'exampleButton', 'newButton' ) # Query the button label using the new object name. # cmds.button( 'newButton', query=True, label=True )