ジャンプ先: 概要. 戻り値.
フラグ. 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' )