3ds Max


The objective of this tutorial is to learn how to:

Before following this tutorial, please make sure 3ds Max Tool Plug-ins are configured correctly. Please see the 3ds Max Setup article for instructions on the configuration necessary to create Prepar3D Models from 3ds Max.

Opening the Model in 3ds Max

For this tutorial, the Oil Rig model will be opened in 3ds Max. After opening 3ds Max, click the main MAX File menu item and then click Open. In the open file dialog, locate the oil rig in the 3ds Max samples folder:

<Lockheed Martin\Prepar3D v4 SDK *>\Modeling\3ds Max\Samples\Oil Rig\Oil Rig.max

Once found, click Open to load the model.

NOTE: If prompted, the file's Gamma & LUT Correction should be adopted.

Testing for a model load

In the modeling view port, there should be an oil rig that is textured. The parts list should verify that there are:

In the Materials Editor window, there is one Multi/Sub-Object Material which includes:

Choose Asset Directory

Organization is important aspect of building content. Therefore, a directory needs to be selected for all of our assets necessary to build the oil rig. For this tutorial's purposes, create a folder named Oil Rig in My Documents to be used throughout the tutorial:

%USERPROFILE%\My Documents\Oil Rig

Exporting from 3ds Max into Prepar3D Intermediate Format (*.X; *.XANIM)

After it has been verified that the model successfully loaded, it can now be exported to an intermediate format that other Prepar3D tools can work with. These tools, in future steps, will use the intermediate files to create the Model that can be loaded into Prepar3D.

To export the model, click the main MAX File menu item and then click Export. In the export file dialog, choose the Oil Rig directory created above, then set the file name and file type as follows:

Afterwards, click Save on the export file dialog. A final Export Options window will appear for export option customization. In this window, check Export Animations since our oil rig is animated (e.g. flag waves in the wind). Finally, press OK and the export process will take place.

Creating a Prepar3D Model from Intermediate Files and Assets

Creating a Prepar3D Model (*.MDL) and Intermediate Placement File

Open up the Command Prompt and type the following to call the XToMDL tool with specific parameters:

"<Lockheed Martin\Prepar3D v4 SDK *>\Modeling\3ds Max\Common\Plugins\XToMDL.exe" /XMLSAMPLE /XANIM "%USERPROFILE%\My Documents\Oil Rig\Oil Rig.X"

The two options that were added for this tutorial are:

NOTE: Make sure to surround both paths in quotes, as shown in the command above, because there are spaces in the path. These scripts don't assume that the Command Prompt has any specific working directory or that XToMDL can be found without using the absolute path. For ease, the current directory can be changed in the Command Prompt or the path to XToMDL can be added to the environment variable PATH if desired.

After running the command, there should be two new files:

Afterwards, open Oil Rig_placement.XML in the text editor of your choice, and remove the XML comments (i.e. <-- ... --!>) around the SceneryObject tag. This is very important and if not done, then the oil rig will not display since it will have a definition but no placement!

Converting Art Assets

Although the Model conversion is completed, the art assets will still need to be converted, preferably to the *.dds format. Open the ImageTool application found here:

"<Lockheed Martin\Prepar3D v4 SDK *>\ImageTool.exe"

This tool is either a GUI (graphical user interface) or CLI (command line interface). By default, it is a GUI and functions as an image importer, viewer, and exporter. For this tutorial, the following images will be converted:

<Lockheed Martin\Prepar3D v4 SDK *>\Modeling\3ds Max\Samples\Oil Rig\texture
|_ oil_rig_texture_1.bmp
|_ oil_rig_texture_2.bmp
|_ oil_rig_texture_3.bmp
|_ oil_rig_texture_4.psd

Using ImageTool, Open each file individually in the location above. Change the format of the image to DXT5 by using the menu bar to click Image->Format->DXT5. Once the format is changed, use the Save As... feature to save each file individually in the *.dds format. Once finished, their respective names and folder will be will be:

%USERPROFILE%\My Documents\Oil Rig
|_ oil_rig_texture_1.dds (DTX5 Format)
|_ oil_rig_texture_2.dds (DTX5 Format)
|_ oil_rig_texture_3.dds (DTX5 Format)
|_ oil_rig_texture_4.dds (DTX5 Format)

Importing a Prepar3D Model into Prepar3D

Creating a Model and Placement File (*.BGL)

A Prepar3D Model by itself will not automatically load in Prepar3D. It can either be used in a Simulation Object or as a placement in the World. For this tutorial, the Oil Rig Model will be placed in the world at the Seattle-Tacoma International Airport which has already been specified by the intermediate placement file. The runtime loadable format of the placement file is *.BGL and the intermediate placement file, Oil Rig_placement.xml, will need to be run through the BGL Compiler in order to output the necessary *.BGL runtime file.

Open up the Command Prompt and type the following to run the BGL Compiler, called bglcomp, to convert the intermediate placement file:

"<Lockheed Martin\Prepar3D v4 SDK *>\World\Scenery\bglcomp.exe" "%USERPROFILE%\My Documents\Oil Rig\Oil Rig_placement.XML"

Upon running the command, there should be a *.BGL file called Oil Rig_placement.BGL in the Oil Rig folder.

Oil Rig Add-on Directory Structure

All of the necessary files have now been converted to runtime formats and are ready to be viewed in Prepar3D. The recommended way of viewing scenery content is to create an Add-on Package that contains a Scenery Component that Prepar3D will load at startup. Before creating the add-on.xml, the files will need to be restructured to match the directory structure expected for Scenery Components. Inside of the Oil Rig folder, create a Oil Rig Add-on folder:

%USERPROFILE%\My Documents\Oil Rig\Oil Rig Add-on

Afterwards, mimic the following directory structure by creating the necessary directories and moving the necessary files into the Oil Rig Add-on folder:
Oil Rig Add-on
| add-on.xml (See below about how to create this file)
|_ scenery
|  |_ Oil Rig_placement.BGL
|_ texture
   |_ oil_rig_texture_1.dds
   |_ oil_rig_texture_2.dds
   |_ oil_rig_texture_3.dds
   |_ oil_rig_texture_4.dds

Creating an Add-on Package

NOTE: For this tutorial's purposes, add-ons are a means to an end in order to allow the content to be shown in Prepar3D. Other methodologies such as manually adding the directory, called Oil Rig Add-on, to the Scenery Library is acceptable.

Add-on Package Files are Prepar3D's add-on file format to specify the content that an add-on contains and where it is located. To learn about how to distribute add-ons visit the Add-ons Overview article and to learn specifically about creating packages visit the Add-on Packages article. For this tutorial, create a file called add-on.xml at the located specified above. Save the following contents into the file:

<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
    <AddOn.Name>Oil Rig</AddOn.Name>
    <AddOn.Description>Oil Rig at Seattle-Tacoma International Airport.</AddOn.Description>
        <Name>Oil Rig</Name>
        <Path>.</Path> <!-- Relative to root add-on directory -->

For Prepar3D to automatically discover the add-on, copy the Oil Rig Add-on folder inside of the Add-ons folder:

%USERPROFILE%\My Documents\Prepar3D v4 Add-ons

If Prepar3D is currently running, then it should be exited at this time.

Viewing Prepar3D Model in Prepar3D

Verify the Add-on Package has loaded

If the add-on package route was taken, upon starting up Prepar3D there will be a prompt specifying whether the Oil Rig add-on should be loaded. Select Yes. To view add-ons that are currently loaded in Prepar3D, use the menu bar and navigate to Options->Add-ons....

In this window, the Oil Rig can be enabled or disabled. If it is not in this window, then either the add-on could not be found or failed to load. Retrace the steps above and make sure to visit the Add-ons Overview to learn more about the add-on process.

Once it is verified that the Oil Rig Add-on is loaded, use the menu bar to navigate to Navigation->Go To Airport... in order to change airports. Select the active runway of Seattle-Tacoma International Airport (KSEA) as your location. Beside your vehicle at the airport there should be an Oil Rig with a moving crane and flag as well as a smoke effect coming from the crane.

If the Oil Rig is not at this location, then please reread the tutorial and determine whether any step was missed. Pay particular attention to the Oil Rig Add-on Directory Structure and verify that all of the file contents exist and were created using the correct procedures.