I spent 3 days trying to export a Gmax model to FSX so I thought I would make a tutorial so people know how to export a model properly without getting any errors like I had.
Get Organised
Ok, first we have to make out folders to work in. Make the following folders:
- C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial
- C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Scenery
- C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Texture
These are the folders where all of our work will be placed. You can put a shortcut on your desktop to easy access if you want.
Get your Textures
You will need to download the following texture to use on your Box (Just right click and click on Save Picture As...)
When using A texture with Gmax, the texture must have a width and height a power of two for D3DRM to work. The texture above is 512 x 512.
Time To Build!
Now open Gmax and load the FSX_GMaxGamepack. This will allow us to create a GUID and export the file as a .MDL file.
When Gmax has loaded, click on the Box button and draw a simple box in the perspective section. We will be applying out texture to this very soon.
Your monitor should be displaying something like this:
The size and shape of the box doesn't matter in this tutorial.
Applying The texture
Right mouse click on your box and select Convert To: > Convert To Editable Poly. Now click on the 3D Box (Element) Button (Screenshot below)
This means that when we apply the texture, it will apply it to the whole box, not just one face.
Now click on The Gmax Materials Editor Button (The round red ball - Screenshot Below)
This will then open the editor, Click New then double click Standard.
Your monitor should now show something like the following:
Click on the grey button next to Defuse and you should get a window like the following:
Double click on Bitmap and open your texture that you saved earlier ( In the directory C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Texture)
You will now get loads of options for editing your texture but we don't need to do that now. Just click on the little blue and white Box and then the Black Arrow next to it. Click on the Blue and white Box Again and then click apply. Your box should now look like this:
Now very attractive is it? Just close the current window and click on Modifiers > UV Coordinates > UVW Map
Select Box from the right hand panel. Your box will now have a texture on it:
Create A GUID
To create a GUID for your Object, just go to FSTools > LODNameTool then click on the button 'Create New GUID For This File'. Gmax will then ask you to create a friendly name for your box. Call it Box and close that window.
SAVE YOUR GMAX FILE IN C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Scenery.
Create Your xml file.
With the FS2004 SDK, Gmax wrote the xml file for you but things have changes in 2 years and now you have to write the xml file yourself. I have included a sample below - just edit the things in bold.
<?xml version="1.0"?>
<FSData
version="9.0"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation="bglcomp.xsd" >
<SceneryObject
lat="S33 25.07"
lon="E149 39.16"
alt="0"
altitudeIsAgl="TRUE"
pitch="0"
bank="0"
heading="0"
imageComplexity="NORMAL">
<LibraryObject
name="{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}"
scale="1.0"/>
</SceneryObject>
<ModelData sourceFile="Box.MDL" />
</FSData>
The xml file needs a GUID, go back to your Gmax file and go to File > File Properties... and click on the Custom Tab. The GUID is in there but you have to type it out yourself, it won't let you copy it. Type the GUID into the
<LibraryObject
name="{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}"
scale="1.0"/>
section of your xml file.
Time To Export
In Gmax, go to File > Export... Locate this folder:
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Scenery
and export the model as a Flightsim Model *.MDL You will then get the following Window - Chosse all the options that I have chosen:
It will export the Gmax file to
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Scenery
but save it as a .MDL file.
[b]Putting The Model Into The Simulator
Move your xml and MDL file to C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\BGL Compiler SDK. Just drag the xml file onto the BglComp.exe and it will create a bgl file for you to put in your addon scenery folder. Before you place the BGL file into your C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Scenery folder, you need to convert your texture to a DDS file. Follow the steps below to do so.
[b]JPG To DDS
Go to the folder C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Terrain SDK and run ImageTool.exe. Now click File > Open and locate your Texture.jpg file. Click open and the texture file will spear in the workspace.
Click on Image > Create MipMaps. This will create about 10 copies of the texture, each getting smaller. Now click on Image > Format > DXT 1.
Now save the file as Texture.DDS and place it in C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Texture
IMPORTANT - DO NOT ENTER ANOTHER NAME FOR THE DDS FILE, YOUR BGL FILE WILL BE LOOKING FOR THE ORIGINAL FILE NAME, NOT THE NEW ONE.
Now you can place your BGL file into C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Addon Scenery\Exporting Tutorial\Scenery and run FSX!
You will need to add the Exporting Tutorial folder into your Scenery Libary and then your scenery is ready to be viewed!
Please tell me if there is any problems with the instructions above and I will sort them out. Also make any other suggestions if you with.
Hope that helps,
John
Edited by John., 16 April 2009 - 10:59 AM.