MAXExporter

This class traverses a 3D Studio MAX§ scenegraph, uses appropriate functionality from a host of other classes, and converts the scenegraph to a comparable Shockwave 3D§ scenegraph.

When to Use

This class is instantiated when MAX_S3D_Plugin::DoExport is called by 3D Studio MAX. This will occur when a user exports a given 3D Studio MAX scene to W3D format. This class instantiates and utilizes functionality from various lower level resource conversion classes such as MAXModelConverter or MAXMaterialConverter.

Interface Methods

Description

MAXExporter

Class constructor

~MAXExporter

Class destructor

DetectUserLights

Scans scenegraph for non-default lights

GetResourceFlags

Returns true if there are any explicit lights in the MAX scenegraph

Initialize

Initializes the class

PreTraverse

Begins the scene traversal and exportation

ScanForAtmospheric

Scans the MAX scene for any atmospheric (environmental) effects

ScanForEffects

Scans the MAX scene for any special effect

WriteSceneToFile

Writes the converted scenegraph to file

GetTexturePalette

Returns the texture palette

AddStyle

Creates and adds a style to a Shockwave 3D model resource

CreateIFXNode

Creates a new Shockwave 3D node

ExportUserProperties

Copies data from a 3D Studio MAX node to a corresponding Shockwave 3D node

GetDefaultViewMatrix

Retrieves the transform matrix of the default view

GetIFXNodeType

Determines the type of Shockwave 3D node to be created based on a MAX node

GetOffsetMatrix

Returns the object offset matrix of a given MAX node

LinkIFXNodeToResource
(This method has three versions.)

Determines the type of corresponding Shockwave 3D node to create

PopulateIFXNode

Populates a Shockwave 3D node with appropriate data

SetIFXNodeResourceId

Links a Shockwave 3D node to an entry within the appropriate resource palette

SetS3DUserProperties

Looks for special user-defined properties set in the authoring tool to control such things as LOD and Visibility

SetModelLODProperties

Looks for special user-defined properties set in the authoring tool to control model-specific properties

Traverse

Traverses and converts a 3D Studio MAX scenegraph to a Shockwave 3D scenegraph


MAXExporter::MAXExporter()

The class constructor.

Parameters:

None

Return Values:

None


MAXExporter::~MAXExporter()

The class destructor.

Parameters:

None

Return Values:

None


MAXExporter::DetectUserLights(INode* pMAXNode, BOOL* bFound)

This method scans the 3D Studio MAX scenegraph for any non-default lights.

Parameters:

pMAXNode

This node will generally be any top-level, non-root node in the 3D Studio MAX scenegraph. This method should be called once for each top-level, non-root node in the scene.

bFound

True if an explicit, non-default light node is found, false otherwise.

Return Values


MAXExporter::GetResourcesFlags ( U16* pFlags )

This method returns flags specifying which types of resources were encountered and exported.

Parameters:

pFlags

Bit field specifying which sorts of resources are found in the current MAX scene

Return Values


MAXExporter::Initialize( ExpInterface *ei, Interface* pIp, S3DProgressDlg* pS3DProgressDlg, AuthConstraints* pInAuthConstraints, IFXExportOptions ExportOptions, U32 uSampleInterval, U32 uAnimationStart, U32 uAnimationEnd, F32 fGeoQualityMetric, U32 uTexQualityMetric, F32 fAnimQualityMetric, BOOL bEnableSDS, U32 m_CapTexSize )

This method performs initialization for this class. The primary difference between this method and the class constructor is that this method is responsible for creating all the various dynamic objects that lie on the heap. The constuctor does not allocate such dynamic objects.

Parameters:

ei

MAX exporter base interface

pIp

MAX core interface

S3DProgressDlg

Reference to the progress dialog used by the exporter

pInAuthConstraints

Authoring constrains object

ExportOptions

Describes which export options the user selected

uSampleInterval

Length of time for which animation sampling (exportation) will occur

uAnimationStart

Start time for the animation sampling period

uAnimationEnd

End time for the animation sampling period

fGeoQualityMetric

Controls geometric quality for exported scenes

uTexQualityMetric

Controls texture quality for exported scenes

fAnimQualityMetric

Controls the degree of animation compression used for a given export

bEnableSDS

Determines whether SDS is enabled

m_CapTexSize

MAX texture size

Return Values


MAXExporter::ScanForAtmospheric ()

This method scans the MAX scene for any atmospheric (environmental) effects. If found, then a list of these effects is created and added to the global unsupported resources dialog list.

Parameters:

None

Return Values


MAXExporter::ScanForEffects ()

This method scans the MAX scene for any special effects. If found, then a list of these effects is created and added to the global unsupported resources dialog list.

Parameters:

None

Return Values


MAXExporter::PreTraverse()

This method begins the scene traversal (and exportation).

Parameters:

None

Return Values


MAXExporter::WriteSceneToFile(const CHAR* pName, IFXExportOptions ExportOptions)

This method writes the Shockwave 3D scenegraph (which was converted from a MAX scenegraph) to a disk file.

Parameters:

pName

Name of the file to which the data is written

ExportOptions

Describes the export options the user has selected

Return Values


MAXExporter:: GetTexturePalette ()

This method returns the texture palette.

Parameters:

None

Return Values:

IFXPalette


MAXExporter::AddStyle(IFXModelResource* pModelResource, ShaderIDList* pShaders, U32* pOutStyleIndex, IFXNode* pIFXNode)

This method creates and adds a style to a given Shockwave 3D model resource.

Parameters:

pModelResource

Model resource to which the style is added

pShaders

List of indices to Shockwave 3D shader objects, which are used to populate the new style

pOutStyleIndex

Index to the Style to be added

pIFXNode

Shockwave 3D node referring to the model resource to which the new style is added

Return Values


MAXExporter::CreateIFXNode( I32 IFXNodeType, INode* pMAXNode, IFXNode* pIFXParentNode,IFXNode **ppOutNode, CIFXString* psName = NULL)

This method creates a new Shockwave 3D node.

Parameters:

IFXNodeType

Specifies the type of Shockwave 3D node to be created

pMAXNode

Group head of a list of MAX nodes to which the newly created Shockwave node corresponds

pIFXParentNode

Parent node of the Shockwave 3D node to be created

ppOutNode

The Shockwave 3D node being created

psName

Name of the Shockwave 3D node being created

Return Values


MAXExporter::ExportUserProperties(INode* pMAXNode, IFXNode* pIFXNode)

This method copies user-defined data from a 3D Studio MAX node to a corresponding Shockwave node.

Parameters:

pMAXNode

MAX node from which user properties are to be copied

pIFXNode

Shockwave 3D node to which user properties are to be copied

Return Values


MAXExporter::GetIFXNodeType(INode* pMAXNode, I32* IFXNodeType)

Given a MAX node, this method will determine the appropriate type of corresponding Shockwave 3D node to create.

Parameters:

pMAXNode

MAX node from which the corresponding Shockwave 3D node type will be determined

IFXNodeType

Type of Shockwave 3D node to be created

Return Values


MAXExporter::GetDefaultViewMatrix(IFXSGMatrix* pViewMatrix)

This method will determine the appropriate type of Shockwave 3D node corresponding to a given a MAX node.

Parameters:

pViewMatrix

Transform matrix associated with the default view

Return Values


MAXExporter::GetOffsetMatrix(INode* pInMAXNode, Matrix3* pOutOffsetMatrix)

This method returns the offset matrix that MAX uses as an additional transform step for a given mesh relative to its pivot.

Parameters:

pInMAXNode

MAX node from which the offset matrix is to be retrieved

pOutOffsetMatrix

Offset matrix

Return Values


MAXExporter::LinkIFXNodeToResource(IFXModel* pIFXModelNode, MAXNodeList* pMAXNodeList)

This method links a Shockwave 3D model node to various resources. Note that many of the resources are also created by calls from this method.

Parameters:

pIFXModelNode

Shockwave 3D node to be linked

pMAXNodeList

List of MAX nodes on which the Shockwave 3D node is based

Return Values


MAXExporter::LinkIFXNodeToResource(IFXLight* pIFXLightNode, MAXNodeList* pMAXNodeList)

This method links a Shockwave 3D light node to various resources. Note that many of the resources are also created by calls from this method.

Parameters:

pIFXLightNode

Shockwave node to be linked

pMAXNodeList

List of MAX nodes on which the Shockwave 3D node is based

Return Values


MAXExporter::LinkIFXNodeToResource(IFXView* pIFXViewNode, MAXNodeList* pMAXNodeList)

This method links a Shockwave 3D model node to various resources. Note that many of the resources are also created by calls from this method.

Parameters:

pIFXViewNode

Shockwave 3D node to be linked

pMAXNodeList

List of MAX nodes on which the Shockwave 3D node is based

Return Values


MAXExporter::PopulateIFXNode(I32 NodeType, IFXNode* pIFXNode, MAXNodeList* pMAXNodeList )

This method populates a Shockwave 3D node with appropriate data. This method will call the appropriate version of LinkIFXNodeToResource as part of its functionality.

Parameters:

NodeType

Shockwave 3D node type

pIFXNode

Name of Shockwave 3D node

pMAXNodeList

List of 3D Studio MAX nodes on which the Shockwave 3D node is based

Return Values


MAXExporter::SetIFXNodeResourceId(IFXNode* pIFXNode, I32 NodeType, U32 ResourceId)

This method links a Shockwave 3D node to an entry within the appropriate resource palette.

Parameters:

pIFXNode

Shockwave 3D node to be linked

NodeType

Type of Shockwave 3D node

ResourceId

Resource identifier

Return Values


MAXExporter:: SetS3DUserProperties (IFXNode *pNode)

This method looks for special user-defined properties set in the authoring tool to control such things as LOD and Visibility.

Parameters:

pNode

The node for which user properties are exported

Return Values


MAXExporter::SetModelLODProperties (IFXNode *pIFXNode)

This method looks for special user-defined properties set in the authoring tool to control model-specific properties, in particular how MRM (LOD) calculations run on the model.

Parameters:

pIFXNode

The node to obtain the data from

Return Values


MAXExporter::Traverse(INode *pCurrentNode, MAXNodeList* pMAXNodeList, IFXNode* pIFXNode)

This method recursively traverses a MAX scenegraph and dynamically converts it to a comparable Shockwave 3D scenegraph.

Parameters:

pCurrentNode

The current 3D Studio MAX node being processed

pMAXNodeList

List of 3D Studio MAX nodes combined and exported to a single Shockwave 3D node. This list is built dynamically during the traverse call sequence.

pIFXNode

The Shockwave 3D node being processed, which is analogous to a list of one or more 3D Studio MAX nodes

Return Values

§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.