Paul Domingue
Resource contributor
- Messages
- 1,532
- Country

Streamlining XtoMDL Across Multiple Platforms
This is an update on my simple compiling system across multiple SDKs for 3ds Max users*. I should also point out that I have never attempted to produce anything for FSXSE so I will leave that for other people to figure out.
What follows is a very simple way of compiling models across all versions of the ESP based flight simulators with the exception of SE as mentioned above. This will allow you to compile native versions for every version from FSX to P3D v4 with just a click of the mouse. The procedure is based on a system first proffered to me by Bill Leaming.
This explanation may seem complicated but the end results are far from complicated.
Let's begin with a look at the supported versions of Max in all versions of P3D. Note; that even though you will want to compile models for FSX, the FSX SDK is no longer needed. Not everyone will have purchased all versions of P3D but all versions of the SDKs are available as free downloads. You want to begin by downloading and installing all four P3D SDKs. By the end of this tutorial you will end up with only one P3D SDK v4.x installed the rest will be uninstalled. We need to copy some files in the earlier versions of the SDKs to make this work.
They can be downloaded from here. http://www.prepar3d.com/support/sdk/
Supported versions of Max **
P3Dv1.4
7, 9, 2009, 2011, 2012
P3Dv2.x
7, 9, 2009, 2011, 2012, 2012x64, 2014x64, 2015x64
P3Dv3.x
7, 9, 2009, 2011, 2012, 2012x64, 2014x64, 2015x64, 2017x64
P3Dv4.x
2012, 2012x64, 2014x64, 2015x64, 2017x64
*I will also examine gMax and Blender and see if I can incorporate them as well.
**Unfortunately one of the most used versions of 3ds Max, Max 9, is no longer supported in P3D's v4.x release. Those still using it can work with v3.x down. I am looking at a work around to enable Max 9 in the v4.x SDK. I will post my results if successful.
Setup
1. Install all four versions of the P3D SDK, v1.4, v2.x, v3.x and v4.x
2. Create a temporary folder.
3. locate one of the 3ds Max Plugins folders in v1.4 SDK (any one will do even if it's not your version of 3ds Max) and copy the folder and all its content to the temporary folder. Rename the Plugins folder to P3Dv1. Do the same for v2.x and v3.x SDKs renaming the Plugins folders P3Dv2 and P3Dv3. Do not do this for the v4.x SDK.
At this point you can uninstall v1.4, v2.x and v3.x SDKs if you wish, they will no longer be needed. Do not uninstall v.4.x SDK. This will be your working SDK.
4. Copy the command string below into a plain text editor such as Notepad or Notepad++.
5. Edit the path statement in between the quotation marks so it points to the modeldef.xml in the bin folder of the v4.x SDK on your system. Do not alter anything else. Note; you can alter the XtoMDL switches before the path statement if needed but this one will serve for aircraft models.
6. Once edited save the command line using the extension .cmd. Use (save as) because your going to save 4 copies with different names. Name them something that reflects the four versions of the SDK. Note that v1.4 SDK is used to compile for FSX as well as P3D. This is how I named them,
Compile_FSX_P3Dv1_MDL.cmd
Compile_P3Dv2_MDL.cmd
Compile_P3Dv3_MDL.cmd
Compile_P3Dv4_MDL.cmd
The P3DvX part of the name corresponds to the renamed folders in the temporary folder we created.
7. Place the first three v1, v2 and v3 .cmd files into the corresponding folders in the temporary folder. So .cmd file P3Dv1 goes into renamed Plugins folder P3Dv1 in the temporary folder, etc.
For .cmd file P3Dv4, place it in the Plugins folder for your version of 3ds Max listed in the P3D v4.x SDK modeling section.
8. Place the three folders in the temporary folder to some appropriate location. This how mine are situated.

9. Go into each folder and the v4.x SDK plugins folder and create a shortcut for each of the four .cmd files. It is very important that you do not change the locations of the .cmd files after you create the shortcuts. If you do move them you will have to create new shortcuts. Gather all four shortcuts and place them in the temporary folder for convenience. Edit the shortcut names to reflect only the file header name. It's not necessary but it cleans things up a bit.
10. Open a new file explorer window and in the path line window type shell:sendto and the Send to folder will open. Drag and drop all four .cmd shortcuts into this window. Close it.

The hard part is done.
If you have not already done it, connect 3ds Max to the v4.x SDK as described in the SDK help file. http://www.prepar3d.com/SDKv4/LearningCenter.php
Export and Compile
In 3ds Max, Export your model to .X, we will call it mymodel.X. I have a folder in my model working folder named Export. All my .X files go there. You can place your exported files anywhere you find appropriate, the compiler won't care.
Select mymodel.X and right click the mouse to bring up the context menu. Select Send to and select the compiler for the native type of MDL you want.

The command line will instruct the XtoMDL compiler to use the same modeldef.xml file that 3ds Max used when exporting the .X file and it will create the mymodel.MDL and a file called mymodel_buildlog.txt placing them in the same location as the original mymodel.X file.
Which compiler you choose will compile a MDL native to that version.
In addition to this simple method of compiling your models, you only have the one modeldef.xml to be concerned about which is in the v4.x SDK rather than across multiple versions of the SDKs.
That's it.
I have tested this method quite extensively and have not encountered a problem so far. If someone should have some difficulty please let me know. Usually it can be attributed to the initial setup or an error in the command line.
Paul
This is an update on my simple compiling system across multiple SDKs for 3ds Max users*. I should also point out that I have never attempted to produce anything for FSXSE so I will leave that for other people to figure out.
What follows is a very simple way of compiling models across all versions of the ESP based flight simulators with the exception of SE as mentioned above. This will allow you to compile native versions for every version from FSX to P3D v4 with just a click of the mouse. The procedure is based on a system first proffered to me by Bill Leaming.
This explanation may seem complicated but the end results are far from complicated.
Let's begin with a look at the supported versions of Max in all versions of P3D. Note; that even though you will want to compile models for FSX, the FSX SDK is no longer needed. Not everyone will have purchased all versions of P3D but all versions of the SDKs are available as free downloads. You want to begin by downloading and installing all four P3D SDKs. By the end of this tutorial you will end up with only one P3D SDK v4.x installed the rest will be uninstalled. We need to copy some files in the earlier versions of the SDKs to make this work.
They can be downloaded from here. http://www.prepar3d.com/support/sdk/
Supported versions of Max **
P3Dv1.4
7, 9, 2009, 2011, 2012
P3Dv2.x
7, 9, 2009, 2011, 2012, 2012x64, 2014x64, 2015x64
P3Dv3.x
7, 9, 2009, 2011, 2012, 2012x64, 2014x64, 2015x64, 2017x64
P3Dv4.x
2012, 2012x64, 2014x64, 2015x64, 2017x64
*I will also examine gMax and Blender and see if I can incorporate them as well.
**Unfortunately one of the most used versions of 3ds Max, Max 9, is no longer supported in P3D's v4.x release. Those still using it can work with v3.x down. I am looking at a work around to enable Max 9 in the v4.x SDK. I will post my results if successful.
Setup
1. Install all four versions of the P3D SDK, v1.4, v2.x, v3.x and v4.x
2. Create a temporary folder.
3. locate one of the 3ds Max Plugins folders in v1.4 SDK (any one will do even if it's not your version of 3ds Max) and copy the folder and all its content to the temporary folder. Rename the Plugins folder to P3Dv1. Do the same for v2.x and v3.x SDKs renaming the Plugins folders P3Dv2 and P3Dv3. Do not do this for the v4.x SDK.
At this point you can uninstall v1.4, v2.x and v3.x SDKs if you wish, they will no longer be needed. Do not uninstall v.4.x SDK. This will be your working SDK.
4. Copy the command string below into a plain text editor such as Notepad or Notepad++.
Code:
xtomdl.exe /xanim /dict:"D:\Program Files\Lockheed Martin\Prepar3D v4 SDK 4.0.23.21468\Modeling\3ds Max\bin\modeldef.xml" /xmlsample %1 >"%~p1\%~n1_buildlog.txt"
5. Edit the path statement in between the quotation marks so it points to the modeldef.xml in the bin folder of the v4.x SDK on your system. Do not alter anything else. Note; you can alter the XtoMDL switches before the path statement if needed but this one will serve for aircraft models.
6. Once edited save the command line using the extension .cmd. Use (save as) because your going to save 4 copies with different names. Name them something that reflects the four versions of the SDK. Note that v1.4 SDK is used to compile for FSX as well as P3D. This is how I named them,
Compile_FSX_P3Dv1_MDL.cmd
Compile_P3Dv2_MDL.cmd
Compile_P3Dv3_MDL.cmd
Compile_P3Dv4_MDL.cmd
The P3DvX part of the name corresponds to the renamed folders in the temporary folder we created.
7. Place the first three v1, v2 and v3 .cmd files into the corresponding folders in the temporary folder. So .cmd file P3Dv1 goes into renamed Plugins folder P3Dv1 in the temporary folder, etc.
For .cmd file P3Dv4, place it in the Plugins folder for your version of 3ds Max listed in the P3D v4.x SDK modeling section.
8. Place the three folders in the temporary folder to some appropriate location. This how mine are situated.

9. Go into each folder and the v4.x SDK plugins folder and create a shortcut for each of the four .cmd files. It is very important that you do not change the locations of the .cmd files after you create the shortcuts. If you do move them you will have to create new shortcuts. Gather all four shortcuts and place them in the temporary folder for convenience. Edit the shortcut names to reflect only the file header name. It's not necessary but it cleans things up a bit.
10. Open a new file explorer window and in the path line window type shell:sendto and the Send to folder will open. Drag and drop all four .cmd shortcuts into this window. Close it.

The hard part is done.
If you have not already done it, connect 3ds Max to the v4.x SDK as described in the SDK help file. http://www.prepar3d.com/SDKv4/LearningCenter.php
Export and Compile
In 3ds Max, Export your model to .X, we will call it mymodel.X. I have a folder in my model working folder named Export. All my .X files go there. You can place your exported files anywhere you find appropriate, the compiler won't care.
Select mymodel.X and right click the mouse to bring up the context menu. Select Send to and select the compiler for the native type of MDL you want.

The command line will instruct the XtoMDL compiler to use the same modeldef.xml file that 3ds Max used when exporting the .X file and it will create the mymodel.MDL and a file called mymodel_buildlog.txt placing them in the same location as the original mymodel.X file.
Which compiler you choose will compile a MDL native to that version.
In addition to this simple method of compiling your models, you only have the one modeldef.xml to be concerned about which is in the v4.x SDK rather than across multiple versions of the SDKs.
That's it.
I have tested this method quite extensively and have not encountered a problem so far. If someone should have some difficulty please let me know. Usually it can be attributed to the initial setup or an error in the command line.
Paul
Last edited:




