ジャンプ先: 概要. 戻り値. フラグ. Python 例.
defineVirtualDevice([axis=int], [channel=string], [clear=boolean], [create=boolean], [device=string], [parent=string], [undefine=boolean], [usage=string])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
defineVirtualDevice は、取り消し可能、照会可能、および編集不可能です。
このコマンドは仮想デバイスを定義します。仮想デバイスは実際のデバイスと同じように動作し、コマンド デバイスがコンピュータに接続されていない場合の、データの操作や再生に便利です。
なし
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
axis, channel, clear, create, device, parent, undefine, usage
ロング ネーム(ショート ネーム) |
引数タイプ |
プロパティ |
|
axis(ax)
|
int
|
|
|
チャネルの軸番号を指定します。子はすべて、親の軸番号と親のチャネルの幅で定義された軸番号を持ちます。このフラグが使用されない場合、チャネルの順序で軸番号が定義されます。
|
|
channel(c)
|
string
|
|
|
-create の開始後、チャネルがデバイス定義に追加されることがあります。チャネル文字列は、デバイスに追加されているチャネルの名前です。-channel フラグも、-usage フラグと場合により -axis フラグを付ける必要があります。
|
|
clear(cl)
|
boolean
|
|
|
-clear オプション デバイスの定義を終了して、定義されたチャネルを破棄します。
|
|
create(cr)
|
boolean
|
|
|
仮想デバイスの定義を開始します。デバイスの定義中であれば、-create フラグはエラーを生成します。
|
|
device(d)
|
string
|
|
|
-device フラグはデバイスの定義を終了します。-create フラグと -device フラグ間のチャネルすべてが指定したデバイスに追加されます。デバイスがすでに存在すれば、このコマンドはエラーになり、デバイスを別のデバイス名で再定義する必要があります。現在定義されているデバイスを確認するには、listInputDevices コマンドを使用します。-device フラグも -undefine と一緒に使用して仮想デバイスの定義を取り消します。
|
|
parent(p)
|
string
|
|
|
定義されるチャネルの親チャネルを指定します。チャネルが存在しない場合、または互換性のないタイプの場合、このコマンドはエラーになります。
|
|
undefine(u)
|
boolean
|
|
|
-device フラグで指定したデバイスの定義を取り消します。
|
|
usage(use)
|
string
|
|
|
-usage オプションは、すべての -channel フラグに必要です。定義されたチャネルの使用タイプを記述します。使用タイプは次のとおりです。
unknown | scalar |
pos | rot |
posRot | quaternion | posQuaternion |
rotXYZ | rotYZX | rotZXY |
rotXZY | rotYXZ | rotZYX |
posRotXYZ | posRotYZX | posRotZXY |
posRotXZY | posRotXZY | posRotZYX |
posX | posY | posZ | rotX |
rotY | rotZ |
|
|
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
import maya.cmds as cmds
# Create a virtual clock and read in some data.
cmds.defineVirtualDevice( create=True )
cmds.defineVirtualDevice( channel='seconds', usage='rotZ', axis=2 )
cmds.defineVirtualDevice( channel='minutes', usage='rotZ', axis=1 )
cmds.defineVirtualDevice( channel='hours', usage='rotZ', axis=0 )
cmds.defineVirtualDevice( device='virtualClock' )
cmds.readTake( device='virtualClock', take='clock.mov' )
# Undefine the virtualClock
cmds.defineVirtualDevice( device='virtualClock', undefine=True )
# Create a body device.
cmds.defineVirtualDevice( create=True )
cmds.defineVirtualDevice( channel='pelvis', usage='posRot' )
cmds.defineVirtualDevice( channel='back', usage='posRot' )
cmds.defineVirtualDevice( channel='head', usage='posRot' )
cmds.defineVirtualDevice( device='body' )
# Explicitly order the axis of the device. The created device is
# the same as the above body device.
cmds.defineVirtualDevice( create=True )
cmds.defineVirtualDevice( channel='head', usage='posRot', axis=12 )
cmds.defineVirtualDevice( channel='back', usage='posRot', axis=6 )
cmds.defineVirtualDevice( channel='pelvis', usage='posRot', axis=0 )
cmds.defineVirtualDevice( device='body' )