MAXModelConverter

This class provides methods to convert a list of 3D Studio MAX§ model nodes to IFXModelResource structures.

Interface Methods

Description

MAXModelConverter

Class constructor

~MAXModelConverter

Class destructor

GrabNormals

Get the normals associated with a mesh

Initialize

Initializes instance of this class

Convert

Converts MAX nodes to IFXModelResouce

ConvertMAXModelsToIFXMeshes

Wraps all conversion of the geometry and materials used by one or more meshes into a single call

ConvertMAXMeshtoAuthorMESH

Converts MAX geometry node into an IFXAuthorMesh

PopulateAuthAllocDesc

Traverses the input meshes and finds the mesh format that will hold all of the mesh components

PopulateBaseVertices

Calculates the base vertices to let the MRM engine preserve them

CollectBoneWeights

Gets the bone IDs and weight pairs associated with each vertex of the mesh

DoSimpleWeighting

Does simple weighting

ApplyTransformMatrix

Transforms vertices and normals of IFXAuthorMesh by tMatrix


MAXModelConverter::MAXModelConverter ()

Class Constructor.

Parameters:

None

Return Values:

None


MAXModelConverter::~MAXModelConverter ()

Class Destructor.

Parameters:

None

Return Values:

None


MAXModelConverter::GrabNormals(Mesh* in_MaxMesh, IFXAuthorMesh* in_AuthMesh)

This method gets the normals associated with a mesh.

Parameters:

in_MaxMesh

The mesh from which to gather normals

in_AuthMesh

The IFXAuthorMesh to stuff the results into

Return Values


MAXModelConverter::Initialize(S3DSceneGraphUtils* in_pSGUtils, ExpInterface *pMAXExportInterface, Interface *pMAXCoreInterface, MAXExporter *pMAXExporter, MAXBonesConverter* in_pBonesConverter, S3DProgressDlg* in_pProgressDlg)

This method Initializes instance of this class.

Parameters:

in_pSGUtils

Scenegraph utilities object

pMAXExportInterface

MAX general exporter interface

pMAXCoreInterface

MAX core interface

pMAXExporter

Main exporter object

in_pBonesConverter

Bones converter

in_pProgressDlg

Progress dialog

Return Values


MAXModelConverter::Convert (MAXNodeList *pMAXNodeList, U32 *out_pNumMaterials, MAXMultiMaterial **out_ppMaterials, IFXModelResource** out_ppModelResource)

Converts a list of MAX Nodes to IFXModelResource.

Parameters:

pMAXNodeList

List of MAX nodes to convert

out_pNumMaterials

Number of materials to be created in the conversion

out_ppMaterials

List of materials that were converted

out_ppModelResource

The IFXModelResouce to be created

Return Values


MAXModelConverter::ConvertMAXModelsToIFXMeshes (MAXNodeList *pMAXNodeList, U32 *pNumMaterials, MAXMultiMaterial **ppMaterials, IFXModelResource** out_ppModelResource)

This method wraps all conversion of the geometry and materials used by one or more meshes in a single call.

Parameters:

pMAXNodeList

List of MAX nodes to convert

pNumMaterials

Number of materials to be created in the conversion

ppMaterials

List of materials that were converted

out_ppModelResource

The IFXModelResouce to be created

Return Values


MAXModelConverter::ConvertMAXMeshtoAuthorMESH ( INode *in_pMAXNode, Matrix3& in_tm, BOOL in_isGroupMember, MAXMaterialMapper* in_MeshMtlMap, bool in_bHasBones, bool in_bHasNegScaling, IFXAuthorMesh **out_ppAuthMesh)

This method converts a MAX geometry node into an IFXAuthorMesh

Parameters:

in_pMAXNode

The node containing the mesh to convert

in_tm

The transformation to apply to the mesh vertices to make them line up with the bones and the IFXNode

in_isGroupMember

Reserved for future use

in_MeshMtlMap

Mapping of MAX material IDs to IFXMaterials

in_bHasBones

Determines whether bones are associated with this mesh

in_bHasNegScaling

Determines whether the mesh is negatively scaled

out_ppAuthMesh

The resulting IFXAuthorMesh

Return Values


MAXModelConverter:: PopulateAuthAllocDesc ( Mesh *in_pMAXMesh, IFXAuthorAllocationDescriptor *out_AuthAllocDesc, bool in_bHasBones )

This method traverses the input meshes and finds the mesh format that will hold all of the mesh components.

Parameters:

in_pMAXMesh

The MAX mesh

out_AuthAllocDesc

The descriptor to hold the data extracted from the MAX mesh

in_bHasBones

Determines whether the mesh has vertex weights from the bones on it

Return Values


MAXModelConverter:: PopulateBaseVertices ( BitArray& vertSel, IFXAuthorMesh* in_AuthorMesh )

This method calculates the base vertices to let the MRM engine preserve them.

Parameters:

vertSel

Description from MAX of the vertices selected

in_AuthorMesh

The mesh on which to flag the vertices

Return Values


MAXModelConverter::CollectBoneWeights ( INode *in_pMaxNode, Mesh *in_pMAXMesh, IFXAuthorMesh *out_AuthMesh)

This method gets the bone IDs and weight pairs associated with each vertex of the mesh.

Parameters:

in_pMaxNode

The MAX node list from which to get the vertex weights

in_pMAXMesh

The specific MAX mesh to be sampled

out_AuthMesh

The IFXAuthorMesh to hold the weights

Return Values


MAXModelConverter::DoSimpleWeighting ( INode *in_pMaxNode, Mesh *in_pMAXMesh, IFXAuthorMesh *out_AuthMesh )

This method does simple weighting for use when a mesh is trivially linked to a bone and no multiweighting is involved.

Parameters:

in_pMaxNode

The node this mesh is for

in_pMAXMesh

The mesh associated with the node

out_AuthMesh

The IFXAuthorMesh into which the weighting is placed

Return Values


MAXModelConverter::ApplyTransformMatrix ( Matrix3 &tMatrix, IFXAuthorMesh * out_pAuthMesh)

This method transforms vertices and normals of IFXAuthorMesh by tMatrix.

Parameters:

tMatrix

The matrix to multiply into all points

out_pAuthMesh

The IFXAuthorMesh to be modified

Return Values

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