ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.

概要

assignInputDevice([clutch=string], [continuous=boolean], [device=string], [immediate=boolean], [multiple=boolean])

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

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

このコマンドは、コマンド文字列(すなわち MEL スクリプト)を入力デバイスに関連付けます。デバイスが移動するかデバイスのボタンが押されると、あたかもコマンドをウィンドウに入力したかのようにコマンド文字列が実行されます。コマンド文字列がボタンの名前またはデバイスの軸を含む場合、これらのボタン/軸の現在値が代入されます。ボタンの値は boolean、軸の値は double として通知されます。

このコマンドは、デバイスのボタンをコマンドに関連付けるのに大変便利です。連続的な動きをキャプチャするデバイスを使うには、ディペンデンシー グラフに直接デバイスをアタッチするのがより効果的です。

戻り値

stringコマンドの結果

照会モードでは、戻り値のタイプは照会されたフラグに基づきます。

関連

attachDeviceAttr, detachDeviceAttr, devicePanel, getInputDeviceRange, getModifiers, listDeviceAttachments, listInputDeviceAxes, listInputDeviceButtons, listInputDevices, recordAttr, setAttrMapping, setInputDeviceMapping, unassignInputDevice

フラグ

clutch, continuous, device, immediate, multiple
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
clutch(c) string create
クラッチ ボタンを指定します。コマンド文字列を実行するためには、このボタンが押されている必要があります。クラッチが指定されていない場合、デバイスの状態が変化する度にコマンド文字列が実行されます。
continuous(ct) boolean create
このフラグが設定されている場合、コマンド文字列は連続的に実行されます(デバイスの状態が変化するごとに一度)。既定では、クラッチ ボタンが指定されている場合、コマンド文字列はボタンが押されたときに一度だけ実行されます。
device(d) string create
コマンド文字列を割り当てるデバイスを指定します。
immediate(im) boolean create
待ち行列を使わずに即座にコマンドを実行します。
multiple(m) boolean create
このフラグが設定されている場合、このデバイスに関連付けられている他のコマンド文字列は削除できません。既定では、新規コマンド文字列がデバイスにアタッチされるときは、他のコマンド文字列はすべて削除されます。

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

Python 例

import maya.cmds as cmds

cmds.assignInputDevice( 'setKeyframe', d='spaceball', c='Button1' )

# This command will assign button1 on the spaceball with
# the setKeyframe command.  This is very much like using
# the spaceball buttons as hotkeys.

cmds.assignInputDevice( '"currentTime -e Axis0"', d='midi', ct=True, m=True )

# This command will execute the command to set the time
# to the value of the first midi slider.  As the slider
# moves this command will be executed.  So the slider
# will control time.