Connects to the specified data servername, creating a named device which then can be attached to device handlers. When the device is defined, it queries queries the server for data axis information. The CapChannelspresent are represented as axis in form channelName.usagefor scalar channels and channelName.componentfor compound channels. See listInputDeviceAxesto list axis names. Note that undoing defineDataServer -d myDevice-s myServerdoes not break the connection with the data server until it cannot be redone. Executing any other command (sphere for example) will cause this to occur. Similarly, the command defineDataServer -d myDevice-u does not break the connection with the data server until it cannot be undone. Either flushUndo, or the ‘defineDataServer’ command fallingoff the end of the undo queue causes this to occur, and the connection. to be broken. No return value.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
device (d) | unicode | ||
|
|||
server (s) | unicode | ||
specifies the name of the server with which the define device connects, and can be specifiied in two ways name– the name of the server socketServer names of the form nameconnect to the server socket on the localhost corresponding to name. If namedoes not begin with /, then /tmp/nameis used. This is the default behavior of most servers. If namebegins with /, namedenotes the full path to the socket. host:service- a udp service on the specified host.The servicecan be any one of a udp service name,a port number,or a named service of tcpmux,and they are found in that order. If hostis omitted, the localhost is used. In any case, if the server cannot be found, the device is not defined (created) and the command fails. |
|||
undefine (u) | bool | ||
undefines (destroys) the dataServer device, closing the connection with the server. Flag can have multiple arguments, passed either as a tuple or a list. |
Derived from mel command maya.cmds.defineDataServer
Example:
import pymel.core as pm
pm.defineDataServer( s='ultratrak_server', d='melvin' )
# Connects to the ultratrak_server running on the localhost and gives it
# the name "melvin"
pm.defineDataServer( s='mocap_lab:5200', d='labFlock' )
# Creates a device called "labFlock" which connects to the server running
# on host "mocap_lab" at port "5200".
pm.defineDataServer( undefine=True, d='labFlock' )
# Delete the device "labFlock" closing the connection with the server
# specified when it was created.