Public Member Functions

ObjectDataReaderCallback Class Reference

This reference page is linked to from the following overview topics: Deferred Loading of Plug-ins.


Search for all occurrences

Detailed Description

See also:
Class TriObject.

Description:
3D Studio DOS allowed developers to store APP_DATA with objects and nodes in the scene. When the 3DS DOS file is imported into 3ds Max, and no plug-in has registered to convert it, then it is just hung off the object (or INode in the case of KXP app data).

A 3ds Max plug-in can register itself to read a particular APP_DATA chunk when a 3DS DOS file is loaded. If a chunk is encountered that matches a registered plug-in, that plug-in will be asked to create an instance of itself based on the contents of the APP_DATA chunk. The plug-in callback is given an opportunity to read the chunk and create an object other than a TriObject based on the contents of the chunk and the original object.

A plug-in that wants to process app data registers a new class derived from this class by calling void RegisterObjectAppDataReader(ObjectDataReaderCallback *cb);

The system then maintains a list of these ObjectDataReaderCallbacks.

#include <istdplug.h>

Inheritance diagram for ObjectDataReaderCallback:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual char *  DataName ()=0
virtual Object ReadData (TriObject *obj, void *data, DWORD len)=0
virtual void  DeleteThis ()=0

Member Function Documentation

virtual char* DataName ( ) [pure virtual]
Remarks:
Returns the name that identifies the app data chunk. When the 3DS Import plug-in is loading objects, it will look for app data. For each app data chunk that the object has, it will go through the list of registered callbacks and call this method looking for a name match. When it does find a match it will call ReadData() on the callback that matched.
virtual Object* ReadData ( TriObject obj,
void *  data,
DWORD  len 
) [pure virtual]
Remarks:
This method is called to read the app data and create an instance of an object based on the data and the original mesh object. For example, the 3D Surfer plug-in from 3DS DOS creates a patch object based on the app data parameters and returns a pointer to it.
Parameters:
TriObject *obj

The original mesh object the app data was assigned to. If no callback was registered, this would be the object that would get created.

void *data

Points to the particular app data chunk handled by the registered callback.

DWORD len

The length of the app data chunk.
Returns:
The Object created by the plug-in to hold the appdata. This would be the object created to take the place of the TriObject. For example, consider a 3DS object that had appdata embedded in it which represented the patch object from which the mesh was created (like 3D Surfer for example). This method would take that data and created a patch object so that the user could work with the object as a patch object in 3ds Max instead of a tri object.
virtual void DeleteThis ( ) [pure virtual]
Remarks:
This method is called to delete this callback object. When the user exits 3ds Max, this method is called on each of the registered callbacks. So if the callback was allocated dynamically, it could free itself in this implementation.

ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback
ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback ObjectDataReaderCallback