ジャンプ先: 概要. 戻り値. キーワード. 関連項目. フラグ. Python 例.
aliasAttr([remove=boolean])
注意:
オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
aliasAttr は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
指定したノードの任意のアトリビュートに対して、エイリアス(代替名)を定義できるようにします。アトリビュートにエイリアスを指定すると、システムはエイリアスを使用してアトリビュートの情報を表示します。 ただし、ユーザはアトリビュートのエイリアスとオリジナルの名前のどちらでも自由に使用できます。アトリビュートには単一のエイリアスしか指定できないため、すでにエイリアスが設定されたアトリビュートにエイリアスを設定すると、古いエイリアスが壊れます。| string[] | 照会モードで使用。 |
戻り値の型は照会モードでは照会フラグが基になります。
| ロング ネーム(ショート ネーム) | 引数型 | プロパティ | ||
|---|---|---|---|---|
remove(rm) |
boolean |
|||
|
||||
import maya.cmds as cmds
cmds.createNode( 'blendShape', n='blender' )
#
# Define intuitive names for the weights of a blendShape.
# The blendShape command does this automatically to allow you
# to refer to the weight corresponding to a target shape by the name
# of that shape.
#
cmds.aliasAttr( 'smile', 'blender.w[0]', 'frown', 'blender.w[1]' )
# Result: 2 #
#
# List all the attribute aliases for the node blendShape1
#
cmds.aliasAttr( 'blender', query=True )
# Result: smile weight[0] frown weight[1] #
#
# Allow the X rotation on a joint to be called its "roll"
#
cmds.createNode( 'joint', n='elbow' )
cmds.aliasAttr( 'roll', 'elbow.rx' )
# Result: 1 #
cmds.aliasAttr( 'tuck', 'elbow.ry' )
# Result: 1 #
#
# Remove the roll alias defined above.
#
cmds.aliasAttr( 'elbow.roll', rm=True )
#
# Remove the tuck alias defined above.
#
cmds.aliasAttr( 'elbow.ry', rm=True )