ジャンプ先: 概要. 戻り値. キーワード. 関連. Python 例.

概要

renameAttr()

注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。

renameAttr は、取り消し可能、照会不可能、および編集不可能です。

指定されたユーザ定義のアトリビュートの名前を、文字列引数で指定された名前に変更します。新しい名前が既存の名前と同じである場合、このコマンドはエラーになります。アトリビュートの名前を空の文字列にすることはできません。

戻り値

string新しい名前。元に戻した場合、オリジナルの名前が返されます。

キーワード

node, connection, rename, attribute, dynamic

関連

addAttr, aliasAttr, attributeInfo, copyAttr, deleteAttr, getClassification, listAttr, nodeType, objExists, objectType, setAttr

Python 例

import maya.cmds as cmds


cmds.sphere( n='sph' )
cmds.addAttr( sn='ms', ln='mass', dv=1.0, min=0.001, max=10000 )
# Rename the long and short names separately
cmds.renameAttr( 'sph.mass', 'length' )
cmds.renameAttr( 'sph.ms', 'ln' )