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 )