Network Rendering

3DS Max Plug-In SDK

Network Rendering

See Also: Class MaxNetManager, Class MaxNet

Overview

One of the new components of 3ds max R4 is a redesigned Network Rendering pipeline and API that allows developers to take full advantage to this easily accessible architecture. The core of the Network Rendering API is exposed through the MaxNetManager class which allows clients to connect to the Network Rendering Manager to perform any and all functions offered. The Network Rendering API encapsulates all the network rendering details and thus leaves the client code to concentrate on whatever it needs to do. The API handles all the networking code and communication protocols.

Within MAX, the Network Job Assignment dialog uses the Network Rendering API to submit new jobs to the network queue while the Queue Manager uses the API to provide all of its functionality. Neither of these components have any other type of network access or private access to network rendering facilities. The MaxNet API provides all of these itself.

The entire API is derived from the MaxNet class, which is used solely for exception handling. In order to handle exceptions you can catch a MaxNet type as follows:

try {

// the code being tried

} catch (MaxNet* maxerr) {

// handle the error

// do NOT delete maxerr

// use maxerr->GetErrorText() to get the error description

// use maxerr->GetError() to get the error code

}

The MaxNet class provides the error code in both numeric form, through GetError() in the form of maxnet_error_t type, and in text form, through GetErrorText(). Most methods in the Network Rendering API will return errors only through this mechamisn, particularly methods that handle network transactions.

The Network Rendering API provides two functions that deal with the creation and destruction of the MaxNetManager class instance, these are, MaxNetManager* CreateManager() and DestroyManager(MaxNetManager* mgr). The CreateManager() function will return a newly created instance of the MaxNetManager class which can be deleted, when done, by DestroyManager().

Queue Control

At any given moment, only one connected client can be in control of the network queue. This means, only one connected client can perform changes. All other clients operate in a "read only" mode.

MaxNetCallBack

The Network Rendering API provides a callback mechanism through the MaxNetManager class. If you wish to use the callback mechanism you can create your own class derived from MaxNetCallBack and pass it as the argument for MaxNetManager::SetCallBack(). All methods are optional, thus you only need to implement those you require.

Network Rendering API by Example

Two full examples on how to use the MaxNet API are included in the SDK under \MAXSDK\SAMPLES\NETRENDER\LISTJOBS and \MAXSDK\SAMPLES\NETRENDER\JOBASSIGN.

Note with these samples that the use of the Network Rendering API is not limited to 3ds max plugins only.