DirectX Extensions for Autodesk 3ds Max

This plug-in tool allows you to export scenes from 3ds Max (version 7) to the DirectX X-File (.x) file format. The exporter supports converting a variety of vertex, mesh, frame-hierarchy, and material data.

Compatibility Chart

Direct3D 9 Direct3D 9 EX Direct3D 10 64-bit Native Mode Windows XP Windows Vista

Yes

No

No

No

Yes

Yes

Installing the Exporter

If Autodesk 3ds Max is already installed, the Microsoft DirectX SDK installation program will configure 3ds Max to automatically find and load the DirectX Extensions for 3ds Max plug-in. If one installs 3ds Max after the DirectX SDK has already been installed then one needs to edit the plugin.ini file located in the 3ds Max installation directory and add the following line to the [Directories] section. Here is an example:

[Directories]
DirectX={SDK ROOT}\Utilities\Bin\Plugins\Max\Max7

Once the plugin.ini is configured properly (either by the DirectX SDK installation program or manually), the plugin automatically loads when 3ds Max starts.

Using the Exporter

Exporting a scene from 3ds Max follows the traditional export workflow. Given a scene that has been loaded or constructed, here is an example of how to export the data:

  1. Select the File->Export menu item.
  2. Enter the filename (such as MyFile.x) in the File name: text box of the dialog that pops up.
  3. Check the Save as Type text box to see that it has DirectX X-File (*.x) in it.
  4. Select Save.

This set of steps saves the entire scene to an x file, including geometry, frame-hierarchy, materials etc. If you would like to save part of a scene instead, select File->Export Selected... in step 1.

Supported Vertex Data

While exporting, the exporter attempts to automatically determine the appropriate vertex data to extract from 3ds Max. The following table explains how vertex data from 3ds Max is mapped to Direct3D vertex element semantics.

3ds Max Data Direct3D Vertex Data Type Direct3D Vertex Element Usage
Vertex float3 POSITION
Normal float3 NORMAL
Binormal float3 BINORMAL
Tangent float3 TANGENT
Color Vertex float4 (r, g, b elements) COLOR0
Alpha Vertex float4 (a element) COLOR0
Illumination Vertex float4 (Scalar value is replicated to r, g, b channels, alpha channel is set to 1.0) COLOR1
Texture Vertex float2 TEXCOORD0

Supported Material Data

The exporter extracts material data from a few classes of 3ds Max materials. In the case of the DirectX Shader Material, the exporter extracts the values for the parameters that appear in the rollout for the Effect in the Material Editor and creates a D3DXDEFAULTEFFECT definition from the parameter values. In the case of a Standard Material, the exporter extracts the diffuse (color and texture), specular color, self-illumination color, opacity, and shininess from 3ds Max and creates a D3DXMATERIAL definition from the data. In the case of a Multi/Sub-Object Material, the exporter extracts one level of sub-materials from the Multi/Sub-Object material and exports the data for them. Multi/Sub-Object materials with more than one level of depth are not supported.

Batch Exporting with the DirectX X-File Exporter

The exporter fully supports unassisted exports via 3ds Max's MAXScript language. The following example shows how to load a file and export it to a .X file using MAXScript.

fn makeXFile maxFile =
(
	baseName = getFilenameFile maxFile
	xPath = getFilenamePath maxFile
	xFile = xPath + baseName + ".x"
	
	makeDir xPath	
	loadMaxFile maxFile quiet:true
	exportFile xFile #noPrompt selectedOnly:false

	return xFile
)

One could then use the function makeXFile to export data as follows:

// creates the file c:\art\maxfiles\dude.x
makeXFile "c:\art\maxfiles\dude.max"