移動先: 概要 戻り値 関連項目. フラグ. Python 例.
attachDeviceAttr([attribute=string], [axis=string], [camera=boolean], [cameraRotate=boolean], [cameraTranslate=boolean], [clutch=string], [device=string], [selection=boolean])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
attachDeviceAttr は 「元に戻す」が可能、「照会」が可能、「編集」が不可能 です。
このコマンドは、デバイス/軸ペアをノード/アトリビュート ペアに関連付けます。
デバイス軸が移動するときに、アトリビュートの値は軸の値に設定されます。この値は、setAttrScale コマンドを使用してスケールとオフセットすることができます。
なし
戻り値の型は照会モードでは照会フラグが基になります。
assignInputDevice, detachDeviceAttr, devicePanel, getInputDeviceRange, getModifiers, listDeviceAttachments, listInputDeviceAxes, listInputDeviceButtons, listInputDevices, recordAttr, setAttrMapping, setInputDeviceMapping, unassignInputDevice
attribute, axis, camera, cameraRotate, cameraTranslate, clutch, device, selection
ロング ネーム(ショート ネーム) |
引数型 |
プロパティ |
device(d)
|
string
|
|
|
clutch(c)
|
string
|
|
|
クラッチ ボタンを指定します。コマンド文字列を実行するためには、このボタンが押されている必要があります。
クラッチが指定されていない場合、デバイスの状態が変化する度にコマンド文字列が実行されます。
|
|
attribute(at)
|
string
|

|
|
axis(ax)
|
string
|
|
|
selection(sl)
|
boolean
|
|
|
このフラグはセレクション リストのノードにアタッチします。
選択を変更するとアタッチメントも変更されるので、コマンドのデフォルト引数とは異なります。
|
|
camera(cam)
|
boolean
|
|
|
このフラグはデバイス/軸をカレント カメラにアタッチします。
デバイス軸とカメラ コントロールの間のマッピングでは、デバイス記述に基づいて経験則を利用します。
そのインタラクションは、マウスやカメラのナビゲーション コントロールのコピーです。
|
|
cameraTranslate(ct)
|
boolean
|
|
|
このフラグは、カレント カメラの移動コントロールにデバイス/軸をアタッチします。
|
|
cameraRotate(cr)
|
boolean
|
|
|
このフラグは、カレント カメラの回転コントロールにデバイス/軸をアタッチします。
|
|
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
cmds.attachDeviceAttr( 'surface1.translateX', d='spaceball', ax='XAxis' )
# This command will assign the XAxis of the spaceball to
# the translateX attribute of surface1. This
# assignment is independent of the selection list (i.e.
# if surface1 was selected when the command is executed,
# surface1 will be translated by the spaceball regardless
# of the current selection.)
cmds.attachDeviceAttr( d='spaceball', ax='XAxis', at='translateX' )
# This command will assign the XAxis of the spaceball to
# the translateX attribute of the selected objects.
cmds.attachDeviceAttr( d='wacom', ax='puck:X', c='puckButton1', at='translateX', sl=True )
cmds.attachDeviceAttr( d='wacom', ax='puck:Y', c='puckButton1', at='translateY', sl=True )
# This command will attach the wacom puck X and Y axes to the
# X and Y translate attributes of the selected items.
# When the selection changes so does the attachment.
# The -c option means you can only move the selected items
# with the puck when button1 on the puck is down.