MAX_S3D_Plugin

This class provides a predefined interface between 3D Studio MAX§ and the Shockwave 3D§ exporter. It is derived from a 3D Studio MAX common base class called SceneExport.

When to use

3D Studio MAX instantiates this class on a per need basis. Methods from this class are called when a user chooses to export a scene to W3D format. This is not, however, the top level exporter class as there is a descriptor class which is used to instantiate this class and provide plug-in information to the MAX core system.

Interface Method

Description

MAX_S3D_Plugin

Class constructor

~MAX_S3D_Plugin

Class destructor

AuthorName

Returns the author name for this plugin

BuildExportOptions

Builds a bitstring for the different export options available

CopyrightMessage

Outputs a copyright message

DoExport

Called by the MAX framework when the S3D export format is selected

Ext

Returns filename extensions associated with this plugin

ExtCount

Returns the number of filename extensions that this plugin provides

GetCfgFilename

Returns the name of the configuration file which is used to save various user settings

GetEnableSDS

Returns TRUE if surface subdivision is enabled

GetEnableProgressive

Returns TRUE if progressive download is enabled

GetPreview

Returns TRUE if the the exported scene is to be previewed

GetExportAnimation

Returns TRUE if the user chooses to export animation data

GetExportGeometry

Returns TRUE if geometry data is exported

GetExportLights

Returns TRUE if the user chooses to export lights

GetExportMaps

Returns TRUE if the user chooses to export texture maps

GetExportMaterials

Returns TRUE if the user chooses to export materials

GetExportShaders

Returns TRUE if the user chooses to export shaders

GetExportScenegraph

Returns TRUE if the user chooses to export the scenegraph hierarchy

GetSampleInterval

Returns the length of time for which animation is to be sampled for export

GetAnimationStart

Returns the start time of the animation sample range

GetAnimationEnd

Returns the ending time of the animation sample range

GetAnimQualityMetric

Returns a scalar that describes the degree of animation compression used for a given export

GetQualityMetric

Returns the overall image quality metric used by the exporter

LongDesc

Returns a long ASCII description of the file type being exported

OtherMessage1

Outputs a developer-defined message

OtherMessage2

Outputs a developer-defined message

ReadConfig

Reads user configuration data from the configuration file

SetPreview

Synchronizes user input that specifies whether or not to preview the exported scene

SetExportAnimation

Synchronizes user input that specifies whether or not to export animation data

SetExportGeometry

Synchronizes user input that specifies whether or not to export geometry data

SetExportLights

Synchronizes user input that specifies whether or not to export lights

SetExportMaps

Synchronizes user input that specifies whether or not to export texture maps

SetExportMaterials

Synchronizes user input that specifies whether or not to export materials

SetExportScenegraph

Synchronizes user input that specifies whether or not to export the scenegraph

GetGeoQualityMetric

Returns a scalar that describes the precision (or quality) of exported geometry

SetExportShaders

Synchronizes user input that specifies whether or not to export shader data

SetSampleInterval

Synchronizes user input from the main dialog, which specifies the animation sampling interval

GetTexQualityMetric

Returns a scalar that describes the precision (or quality) of exported textures

GetCapTexSize

Returns texture cap size

GetReportResults

Returns TRUE if export results are to be displayed

GetReportAuthoring

Returns TRUE if authoring checks are enabled

SetAnimationStart

Synchronizes user input that specifies the animation sampling start time

SetAnimationEnd

Synchronizes user input that specifies the animation sampling stop time

SetAnimQualityMetric

Returns a scalar that describes the precision (or quality) of exported textures

SetQualityMetric

Synchronizes user input that is obtained via the main dialog, which specifies the overall export quality metric

SetGeoQualityMetric

Sets a scalar that controls quality of exported geometry

SetTexQualityMetric

Sets a scalar that controls quality of exported textures

SetEnableSDS

Sets state of whether or not to enable surface

SetCapTexSize

Sets texture cap size

SetReportResults

Sets state of whether or not to display export results

SetReportAuthoring

Sets state of whether or not to display authoring warnings

ShortDesc

Returns a short ASCII description of the file type being exported

ShowAbout

Displays an About dialog box

SupportsOptions

Determines if one or more export options are supported by a plug-in for a given extension

Version

Returns the version number of the plugin

WriteConfig

Writes user-configuration data to a configuration file


MAX_S3D_Plugin::MAX_S3D_Plugin()

This is the class constructor. It initializes various internal fields used by the class.

Parameters:

None

Return Values:

None


MAX_S3D_Plugin::~MAX_S3D_Plugin()

This is the class destructor.

Parameters:

None

Return Values:

None


MAX_S3D_Plugin::AuthorName()

This method returns the author name for this plug-in.

Parameters:

None

Return Values:

virtual const TCHAR*

This is the author’s name.


MAX_S3D_Plugin:: BuildExportOptions()

This method builds a bitstring for the different export options available. These include geometry resources and material resources.

Parameters:

None

Return Values


MAX_S3D_Plugin::CopyrightMessage()

This method outputs a copyright message.

Parameters:

None

Return Values:

const TCHAR*

This is the copyright message.


MAX_S3D_Plugin::DoExport(const TCHAR* pName,ExpInterface* ei, Interface* i, BOOL suppressPrompts, DWORD options)

This method is called by the MAX framework when the S3D export format is selected. The S3D converter classes are instatiated from within this method. Calls to the converter classes that handle the actual conversion are also called from this method.

Parameters:

pName

This is the name of the output (S3D) file.

ei

This is an exporter base class that the MAX API provides for plugin authors.

i

This is the interface of the core of the MAX API.

suppressPrompts

This indicates whether or not the plugin is to be run in automated (batch) mode, or if the plugin requires user intervention. If this parameter is true, this plugin is to be run in batch mode.

options

This provides for expanded user-definable parameters.

Return Values:

I32

This returns non-zero if this method functioned correctly, 0 otherwise.


MAX_S3D_Plugin::Ext(int i)

This method returns filename extensions associated with this plug-in.

Parameters:

i

Determines which extenstion is returned.

Return Values:

const TCHAR*

This is the actual filename extension.


MAX_S3D_Plugin::ExtCount()

This method returns the number of filename extensions that this plug-in provides.

Parameters:

None

Return Values:

I32

This is the number of filename extensions provided.


MAX_S3D_Plugin::GetAnimationEnd()

This method returns the ending time of the animation sample range. This time (along with the animation start time) specifies how much of the animation is to be exported.

Parameters:

None

Return Values:

U32

This is the end time for the animation sampling range.


MAX_S3D_Plugin::GetAnimationStart()

This method returns the start time of the animation sample range. This time (along with the animation end time) specifies how much of the animation is to be exported.

Parameters:

None

Return Values:

U32

This is the start time for the animation sampling range.


MAX_S3D_Plugin::GetAnimQualityMetric()

This method returns a scalar that describes the degree of animation compression used for a given export.

Parameters:

None

Return Values:

F32

This is the animation compression metric.


MAX_S3D_Plugin::GetCfgFilename()

This method returns the name of the configuration file which is used to save various user settings. An example would be the export options or the animation sampling times.

Parameters:

None

Return Values:

TSTR

This is the configuration filename.


MAX_S3D_Plugin::GetExportAnimation()

This method returns True if the user chooses to export animation data.

Parameters:

None

Return Values:

BOOL

This is TRUE if the animation is to be exported. It will be false otherwise.


MAX_S3D_Plugin::GetExportGeometry()

This method returns TRUE if geometry data is exported.

Parameters:

None

Return Values:

BOOL

This is TRUE if the geometry is to be exported. It will be false otherwise.


MAX_S3D_Plugin::GetExportLights()

This method returns TRUE if the user chooses to export lights.

Parameters:

None

Return Values:

BOOL

This is TRUE if the lights are to be exported. It will be false otherwise.


MAX_S3D_Plugin::GetExportMaps()

This method returns TRUE if the user chooses to export texture maps.

Parameters:

None

Return Values

BOOL

This is TRUE if the texture maps are to be exported. It will be false otherwise.


MAX_S3D_Plugin::GetExportMaterials()

This method returns TRUE if the user chooses to export materials.

Parameters:

None

Return Values:

BOOL

This is TRUE if the materials are to be exported. It will be false otherwise.


MAX_S3D_Plugin::GetExportShaders()

This method returns TRUE if the user chooses to export shaders.

Parameters:

None

Return Values:

BOOL

This is TRUE if the shaders are to be exported. It will be false otherwise.


MAX_S3D_Plugin::GetExportScenegraph()

This method returns TRUE if the user chooses to export the scenegraph hierarchy.

Parameters:

None

Return Values:

BOOL

This is TRUE if the scenegraph hierarchy is to be exported. It will be false otherwise.


MAX_S3D_Plugin::GetGeoQualityMetric()

This method returns a scalar that describes the precision (or quality) of exported geometry.

Parameters:

None

Return Values:

F32

This is the precision of the exported geometry.


MAX_S3D_Plugin::GetPreview()

This method returns True if the the exported scene is to be previewed.

Parameters:

None

Return Values:

BOOL

This is true if the export preview is to be displayed. It will be false otherwise.


MAX_S3D_Plugin::GetQualityMetric()

This method returns the overall image quality metric used by the exporter. The range is from 0 to 1000, with 1000 being minimal compression, and 0 being maximum compression.

Parameters:

None

Return Values:

U32

This is the quality metric.


MAX_S3D_Plugin::GetSampleInterval()

This method returns the length of time for which animation is to be sampled for export.

Parameters:

None

Return Values:

U32

This is the sample interval.


MAX_S3D_Plugin::GetTexQualityMetric()

This method returns a scalar that describes the precision (or quality) of exported textures.

Parameters:

None

Return Values:

F32

This is the precision of the exported textures.


MAX_S3D_Plugin::LongDesc()

This method returns a long ASCII description of the file type being exported.

Parameters:

None

Return Values:

const TCHAR*

This is the long description of the type of export.


MAX_S3D_Plugin::OtherMessage1()

This method writes out a developer-defined message.

Parameters:

None

Return Values:

const TCHAR*

The message.


MAX_S3D_Plugin::OtherMessage2()

This method writes out a developer-defined message.

Parameters:

None

Return Values:

const TCHAR*

The message.


MAX_S3D_Plugin::ReadConfig()

This method reads user-configuration data from the configuration file.

Parameters:

None

Return Values:

BOOL

0 if successful, 1 otherwise.

Comments:

See GetCfgFilename and WriteConfig.


MAX_S3D_Plugin::SetPreview(BOOL val)

This method synchronizes user input that specifies whether or not to preview the exported scene with an internal state variable.

Parameters:

val

This is TRUE if the preview state variable is to be asserted. It will be FALSE otherwise.

Return Values:

None


MAX_S3D_Plugin::SetExportAnimation(BOOL val)

This method synchronizes user input that specifies whether or not to export animation data with an internal state variable.

Parameters:

val

This is TRUE if the animation export state variable is to be asserted. It will be FALSE otherwise.

Return Values:

None


MAX_S3D_Plugin::SetExportGeometry(BOOL val)

This method synchronizes user input that specifies whether or not to export geometry data with an internal state variable.

Parameters:

val

This is TRUE if the geometry export state variable is to be asserted. It will be FALSE otherwise.

Return Values:

None


MAX_S3D_Plugin::SetExportLights(BOOL val)

This method synchronizes user input that specifies whether or not to export lights with an internal state variable.

Parameters:

val

This is TRUE if the lights export state variable is to be asserted. It will be FALSE otherwise.

Return Values:

None


MAX_S3D_Plugin::SetExportMaps(BOOL val)

This method synchronizes user input that specifies whether or not to export texture maps with an internal state variable.

Parameters:

val

This is TRUE if the map export state variable is to be asserted. It will be FALSE otherwise.

Return Values:

None


MAX_S3D_Plugin::SetExportMaterials(BOOL val)

This method synchronizes user input that specifies whether or not to export materials with an internal state variable.

Parameters:

val

This is TRUE if the material export state variable is to be asserted. It will be FALSE otherwise.

Return Values:

None


MAX_S3D_Plugin::SetExportScenegraph(BOOL val)

This method synchronizes user input that specifies whether or not to export the scenegraph with an internal state variable.

Parameters

val

This is TRUE if the scenegraph export state variable is to be asserted. It will be FALSE otherwise.

Return Values:

None


MAX_S3D_Plugin::SetExportShaders(BOOL val)

This method synchronizes user input that specifies whether or not to export shader data with an internal state variable.

Parameters:

val

This is TRUE if the shader export state variable is to be asserted. It will be FALSE otherwise.

Return Values:

None


MAX_S3D_Plugin::SetSampleInterval(U32 val)

This method synchronizes user input that specifies the animation sampling interval with an internal state variable.

Parameters:

val

This specifies the animation sampling interval.

Return Values:

None


MAX_S3D_Plugin::SetAnimationStart(U32 val)

This method synchronizes user input that specifies the animation sampling start time with an internal state variable.

Parameters:

val

This specifies the animation sampling start time.

Return Values:

None


MAX_S3D_Plugin::SetAnimationEnd(U32 val)

This method synchronizes user input that specifies the animation sampling end time with an internal state variable.

Parameters

val

This specifies the animation sampling end time.

Return Values:

None


MAX_S3D_Plugin::SetAnimQualityMetric(F32 val)

This method returns a scalar that describes the precision (or quality) of exported textures.

Parameters:

val

This is the animation compression metric.

Return Values:

None


MAX_S3D_Plugin::SetGeoQualityMetric(F32 val)

This method sets a scalar that controls the quality of exported geometry.

Parameters:

val

This is the geometric compression metric.

Return Values:

None


MAX_S3D_Plugin::SetTexQualityMetric(F32 val)

This method sets a scalar that controls quality of exported textures.

Parameters:

val

This is the textures compression metric.

Return Values:

None


MAX_S3D_Plugin::SetQualityMetric(U32 val)

This method synchronizes user input that specifies the overall export quality metric with an internal state variable.

Parameters:

val

This specifies the quality metric.

Return Values:

None


MAX_S3D_Plugin::ShortDesc()

This method returns a short ASCII description of the file type being exported.

Parameters:

None

Return Values:

const TCHAR*

This is the short file type description.


MAX_S3D_Plugin::ShowAbout(HWND hWnd)

This method displays an About dialog box.

Parameters:

hWnd

Handle to MAX main window.

Return Values:

None


MAX_S3D_Plugin::SupportsOptions(I32 ext, DWORD options)

This method determines if one or more export options are supported by a plug-in for a given extension. It returns TRUE if all option bits set are supported for this extension; otherwise it returns FALSE.

Parameters:

ext

This parameter indicates for which extension the options are being queried.

options

This specifies which options are being queried.

Return Values:

BOOL

1 if successful, 0 otherwise.


MAX_S3D_Plugin::Version()

This method returns the version number of the plug-in.

Parameters:

None

Return Values:

U32

This is the plugin version number.


MAX_S3D_Plugin::WriteConfig()

This method writes configuration data to a file.

Parameters:

None

Return values:

None


MAX_S3D_Plugin::GetEnableSDS()

This method determines if subdivision subdivision is enabled. It returns TRUE if it is enabled; otherwise it returns FALSE.

Parameters:

None

Return Values:

BOOL

1 if successful, 0 otherwise.


MAX_S3D_Plugin::GetEnableProgressive()

This method determines if progressive downlead is enabled. It returns TRUE if it is enabled; otherwise it returns FALSE.

Parameters:

None

Return Values:

BOOL

1 if successful, 0 otherwise.


MAX_S3D_Plugin::GetCapTexSize()

This method returns texture cap size.

Parameters:

None

Return Values:

U32

Size


MAX_S3D_Plugin::GetReportResults()

This method determines if export results are to be displayed. It returns TRUE if it is enabled; otherwise it returns FALSE.

Parameters:

None

Return Values:

BOOL

1 if successful, 0 otherwise.


MAX_S3D_Plugin::GetReportAuthoring()

This method determines if authoirng checks are enabled. It returns TRUE if all option bits set are supported for this extension; otherwise it returns FALSE.

Parameters:

None

Return Values:

BOOL

1 if successful, 0 otherwise.


MAX_S3D_Plugin::SetEnableSDS(BOOL, val)

This method sets state of whether or not to enable surface subdivision.

Parameters:

val

This is TRUE if the surface subdivsion is enabled. It will be FALSE otherwise.

Return Values:

None 


MAX_S3D_Plugin::SetCapTexSize(U32, val)

This method sets texture cap size.

Parameters:

val

Texture cap size

Return Values:

None 


MAX_S3D_Plugin::SetReportResults (U32, val)

This method state of whether or not to display export results.

Parameters:

val

This is TRUE (=any number except 0) if the export results are displayed. It will be FALSE (=0) otherwise.

Return Values:

None 


MAX_S3D_Plugin::SetReportAuthoring(U32, val)

This method sets state of whether or not to display authoring warnings.

Parameters:

val

This is TRUE (=any number except 0) if the export results are displayed. It will be FALSE (=0) otherwise.

Return Values:

None 

 

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