This reference page is linked to from the following overview topics: Autodesk Maya 2013.
Base class for client device creation.
MPxClientDeviceNode is an extension of MPxThreadedDevice node, and is intended for creating maya devices that act as clients. An example of this will be a Maya device that listens for animation data that is sent from another application.
See MPxThreadedDevice node for details on how to use the memory queue system
Plug-ins should create the MPxClientDeviceNode with a kCustomClient parameter.
This class contains the serverName and deviceName attributes. If these attributes are changed, the node will restart the thread so that processing will continue with the new settings.
NOTE: This class relies on the idle event queue to perform the node attribute updating. As a result, it will not work in Maya batch mode.
#include <MPxClientDeviceNode.h>
Public Types | |
enum | ClientType { kUser, kInternal } |
Defines the type client server. More... | |
Public Member Functions | |
MPxClientDeviceNode (ClientType typ=kUser) | |
Constructor. | |
virtual | ~MPxClientDeviceNode () |
Class destructor. | |
virtual MPxNode::Type | type () const |
Returns the type of node that this is. | |
ClientType | clientType () |
Returns the client type of this node. | |
virtual void | threadHandler (const char *serverName, const char *deviceName) |
This method should be overridden in user defined nodes rather than the parameterless version that exists in the base class. | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. | |
Static Public Attributes | |
static MObject | serverName |
Server. | |
static MObject | deviceName |
Device. |
enum ClientType |
Defines the type client server.
MPxClientDeviceNode | ( | MPxClientDeviceNode::ClientType | type = kUser | ) |
Constructor.
The constructor should never call any methods from MPxNode or make any calls that require the existence of the MObject associated with the user defined node. The postConstructor method should be used to do any initialization of this kind.
For example, the postConstructor method would be used to call: setRefreshOutputAttributes()
[in] | type | specify what type of client will be implemented |
MPxNode::Type type | ( | ) | const [virtual] |
Returns the type of node that this is.
This is used to differentiate user defined nodes that are derived off different MPx base classes.
It is not necessary to override this method.
Reimplemented from MPxThreadedDeviceNode.
MPxClientDeviceNode::ClientType clientType | ( | ) |
void threadHandler | ( | const char * | serverName, |
const char * | deviceName | ||
) | [virtual] |
This method should be overridden in user defined nodes rather than the parameterless version that exists in the base class.
Thread management( creation/destruction/shutdown ) will be handled by Maya. This method will be called when the thread has been created. In a typical implementation, the thread handler will implement a loop for reading information from an external device.
[in] | serverName | current server name |
[in] | deviceName | current device name |
const char * className | ( | ) | [static] |
Returns the name of this class.
Reimplemented from MPxThreadedDeviceNode.