Public Member Functions

Tex3D Class Reference

This reference page is linked to from the following overview topics: Material and Texture Map Plug-ins, Plug-in Base Classes.


Search for all occurrences

Detailed Description

See also:
Class Texmap, Working with Materials and Textures.

Description:
Developers that have created a 3D Studio/DOS SXP and a corresponding 3ds Max texture plug-in may want to subclass from this class. It provides a way to have an instance of your 3ds Max texture plug-in created automatically when the corresponding SXP is found in a 3DS file being imported.

This works as follows:

In the 3ds Max texture plug-in's implementation of DllMain() the following function is called:

void RegisterSXPReader(MCHAR *sxpName, Class_ID cid);

The plug-in passes its own SXP name (i.e. "MARBLE_I.SXP") and its own Class_ID.

The system then remembers this. When the 3DStudio import plug-ins is loading a .3DS file and it encounters an SXP with this name, it will create an instance of the plug-in class (using the Class_ID) and call the method of this class ReadSXPData(). The plug-in can then initialize itself with proper values by reading the old SXP data.

A sample plug-in that uses this technique is the 3ds Max Marble texture. It imports the settings from the 3D Studio Marble SXP. See the sample code in /MAXSDK/SAMPLES/MATERIALS/MARBLE.CPP.

#include <stdmat.h>

Inheritance diagram for Tex3D:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void  ReadSXPData (MCHAR *name, void *sxpdata)=0

Member Function Documentation

virtual void ReadSXPData ( MCHAR *  name,
void *  sxpdata 
) [pure virtual]
Remarks:
This method is called when the 3D Studio/DOS import plug-in encounters an SXP with the name registered by RegisterSXPReader().
Parameters:
MCHAR *name

The name of the SXP.

void *sxpdata

This is the SXP's initialization data. The plug-in can look at this data to see what numbers it was initialized to in the .3DS file being imported. It can then set its initial value to match the SXP settings.

Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D
Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D Tex3D