Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

defineVirtualDevice [-axis int] [-channel string] [-clear] [-create] [-device string] [-parent string] [-undefine] [-usage string]

defineVirtualDevice is undoable, queryable, and NOT editable.

This command defines a virtual device. Virtual devices act like real devices and are useful to manipulate/playback data when an command device is not connected to the computer.

Return value

None

In query mode, return type is based on queried flag.

Flags

axis, channel, clear, create, device, parent, undefine, usage
Long name (short name) Argument types Properties
-axis(-ax) int create
Specifies the axis number of the channel. All children have their axis number determined by their parent's axis number and the width of the parent channel. If this flag is not used, the order of the channel determines the axis number.
-channel(-c) string create
After a -create is started, channels may be added to the device definition. The channel string wil be the name of the channel being added to the device. The -channel flag must also be accompanied by the -usage flag and optionally by the -axis flag.
-clear(-cl) create
The -clear option will end a device definition and throw away any defined channels.
-create(-cr) create
Start defining a virtual device. If a device is currently being defined, the -create flag will produce an error.
-device(-d) string create
The -device flag ends the device definition. All of the channels between the -create flag and the -device flag are added to the specified device. If that device already exists, the command will fail and the device should be redefined with another device name. To see the currently defined devices, use the listInputDevices command. The -device flag is also used with -undefine to undefine a virtual device.
-parent(-p) string create
Specified the parent channel of the channel being defined. If the channel does not exist, or is an incompatible type, the command will fail.
-undefine(-u) create
Undefines the device specified with the -device flag.
-usage(-use) string create
The -usage option is required for every -channel flag. It describes what usage type the defined channel is. The usage types are:
unknownscalar
posrot posRotquaternionposQuaternion
rotXYZrotYZXrotZXY rotXZYrotYXZrotZYX
posRotXYZposRotYZXposRotZXY posRotXZYposRotXZYposRotZYX
posXposYposZrotX rotYrotZ

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

//    Create a virtual clock and read in some data.
defineVirtualDevice -create;
defineVirtualDevice -channel seconds -usage rotZ -axis 2;
defineVirtualDevice -channel minutes -usage rotZ -axis 1;
defineVirtualDevice -channel hours -usage rotZ -axis 0;
defineVirtualDevice -device virtualClock;
readTake -device virtualClock -take clock.mov;

//    Undefine the virtualClock
defineVirtualDevice -device virtualClock -undefine;

//    Create a body device.
defineVirtualDevice -create;
defineVirtualDevice -channel pelvis -usage posRot;
defineVirtualDevice -channel back -usage posRot;
defineVirtualDevice -channel head -usage posRot;
defineVirtualDevice -device body;

//    Explicitly order the axis of the device. The created device is
//    the same as the above body device.
defineVirtualDevice -create;
defineVirtualDevice -channel head -usage posRot -axis 12;
defineVirtualDevice -channel back -usage posRot -axis 6;
defineVirtualDevice -channel pelvis -usage posRot -axis 0;
defineVirtualDevice -device body;