Tutorial
Overview
The objective of this tutorial is to learn how to:
- Open the Oil Rig Max File that is included in the samples
- Export the Oil Rig Max File to an intermediate format that can be used to create a Model for Prepar3D
- Use the relevant tools on the exported files and associated textures to create a Model that Prepar3D can load
- Import the Oil Rig as a Model in Prepar3D at a specific location in the world
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:
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:
- 3 different LODs with different model parts contained within each
- A Platform that is tagged with custom Prepar3D data so that the system respects it as a platform
- A flag that uses a Prepar3D Material without a texture
- Bones that allow the crane and flag to animate
In the Materials Editor window, there is one Multi/Sub-Object Material which includes:
- Flag Material
- Crane Texture Material
- Crane Railing Material
- Platform Material
- Support Beam Material
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:
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:
- File directory: <Asset Directory>
- File name: Oil Rig
- Save as type: ESP 1.0 DirectX File (*.X)
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:
The two options that were added for this tutorial are:
- /XMLSAMPLE: This will output a placement file that references the model. This will later be used to create a Model and Placement File (*.BGL). The placement of this model is by default at the Seattle-Tacoma International Airport.
- /XANIM: This option will specify that there are corresponding animations to the model and an appropriate *.XANIM file should be resolved during the compilation phase.
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:
- Oil Rig.MDL: This is the compiled Prepar3D Model file of the oil rig and its animations.
- Oil Rig_placement.XML: This is an intermediate placement file that places the Oil Rig Model at the Seattle-Tacoma International Airport.
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:
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:
|
|_ 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:
|
|_ 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:
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:
|
| 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> <AddOn.Component> <Category>Scenery</Category> <Name>Oil Rig</Name> <Path>.</Path> <!-- Relative to root add-on directory --> </AddOn.Component> </SimBase.Document> |
For Prepar3D to automatically discover the add-on, copy the Oil Rig Add-on folder inside of the Add-ons folder:
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.