ジャンプ先: 概要. 戻り値. 関連. フラグ. 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
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
attribute(at) string createmultiuse
アタッチ先のアトリビュートを指定します。
axis(ax) string create
アタッチ元の軸を指定します。
camera(cam) boolean create
このフラグはデバイス/軸を現在のカメラにアタッチします。デバイス軸とカメラ コントロールの間のマッピングでは、デバイス記述に基づいて経験則を利用します。そのインタラクションは、マウスやカメラのナビゲーション コントロールのコピーです。
cameraRotate(cr) boolean create
このフラグは、現在のカメラの回転コントロールにデバイス/軸をアタッチします。
cameraTranslate(ct) boolean create
このフラグは、現在のカメラの移動コントロールにデバイス/軸をアタッチします。
clutch(c) string create
クラッチ ボタンを指定します。コマンド文字列を実行するためには、このボタンが押されている必要があります。クラッチが指定されていない場合、デバイスの状態が変化する度にコマンド文字列が実行されます。
device(d) string create
コマンド文字列を割り当てるデバイスを指定します。
selection(sl) boolean create
このフラグはセレクション リストのノードにアタッチします。選択を変更するとアタッチメントも変更されるので、コマンドの既定の引数とは異なります。

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。

Python 例

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.