• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX 3DS Max MDL

Thank you Tic but I have it working properly.

What I want to do are two things.
1. Have the process when terminated exit the command dialog (close the window).
2. When I select the (file name).X and right click for the (send to) menu, I would like the file prefix to be attached to the build log as in >(file name)log.txt

Currently I use batch files that do exactly that and while working on a particular model there isn't that much trouble going through the process of compiling since it is so repetitive testing the same model over and over again the single batch file will suffice. The only time that the batch file needs a minute's worth of editing is when I work on something else.

I want to take n4gix's method and make it better if possible. On the other hand I'm also supportive of Hughes-MDflyer4's XtoMDL UI. His programming skills have been employed into something that for newcomers to modeling for FS will make it easier to compile their work without knowing various aspects of Windows or following a tutorial, just run it and your done. He's young and smart so I'm happy to back the future, pun intended. :)

For those who might think I'm being nit picky let me tell you I'm an old school DOT prompt guy who just likes problems to tinker with and at my age anything that keeps my mind active is a good thing.
...........where was I? :confused:
 
Whatever fits for you is good. Congratulation!
Command line and batch file are nightmare to me.
Imagine someone who is illiterate in computer world, that's me.
 
Last edited:
I have found the fix for item 1. in my list above. In order to have the Command Window close when compilation is completed the /K in the Target line needs to changed to /C. The /K switch (run command then return to the CMD prompt), /C (run command then terminate).
Now I'm working on solving item 2. and there is a way to pass the prefix of the .X file to a variable then convert to a string and attach it to the prefix of the buildlog.txt file but I have not figured it out yet. I have had to go back and relearn batch programming since it has been years since I worked with it. The string in the Target line is basically one long batch file command line.
 
Good find, Paul!

It's easy enough to pass variables in the command line using %1 through %9. Perhaps using %1_buildlog.txt might do the trick?
 
Good find, Paul!

It's easy enough to pass variables in the command line using %1 through %9. Perhaps using %1_buildlog.txt might do the trick?
I tried that but it's not accepting it. I tried %(tilde)n0, n1 etc. (there is no tilde symbol on my phone). I also tried set var=%1 then >"%var%".txt. still no luck. I'm going to keep playing with it.
 
Well I got item 2. on my little list done and in the process eliminated the need for item 1. It's funny how something that seems difficult turns out to be really simple. What I didn't know was that %1 once it is called by XtoMDL returns a null string so it can't be used with the buildlog.txt file name. The way to get around this is to add %1 as the file name in the XtoMDL command line then attach %~n1 to the log file name.
%1 returns the filename+extension but only once.
%~n1 returns only the filename without the extension.

What I have done is an improvement on n4gix's method which thanks to him I would never have worked on so I have to give him most of the credit. It's just a little bit better mouse trap. So here goes.

This is totally generic so you don't have to worry about any settings of paths for your particular system.

1. Open up Notepad or Notepad++ or any pure ASCII editor.
2. Enter the XtoMDL command line with the switches you will need for aircraft or scenery compilation.
3. At the end of the XtoMDL command line (do not enter the name of the .X file) instead type %1 >%~n1_buildlog.txt (be sure there is a space before and after %1)

Example: (you can copy and paste this line if you wish for an aircraft model it will work on your computer exactly as is)

Code:
xtomdl.exe /xanim /dict:..\..\bin\modeldef.xml /xmlsample %1 >%~n1_buildlog.txt

4. Save the file with an appropriate name and a .cmd extension.
5. Place the filename.cmd file in the plugins folder of the SDK you are using.
6. Right click on the file and SendTo the desktop as a Shortcut.
7. Open your Windows explorer and navigate to:
C:\Windows\Users\Username\AppData\Roaming\Microsoft\Windows\SendTo\ and drag the shortcut into this folder.

That's it. You can now right click on your .X file and SendTo the filename.cmd you just created and the model file will be created as well as a file named (modelname_buildlog.txt) in the plugins folder.

Again this is totally generic and will work on any system with any SDK to the best of my knowledge. If you should encounter a problem please let me know.

Paul
 
This is an update to the .cmd line structure.
I discovered that it doesn't matter where your .X file is located when you use SendTo and all the generated files will be placed in the same folder location as your .X file except for the buildlog.txt. This small change will now place the build log in the same folder as your .X file. It just makes things a little neater.
I export my .X file to a folder called, what else, export that is within the project folder. When I right click/SendTo everything ends up in this folder.
The trick was to add the path to the .X file with %~p1 and enclose in quotation marks.

The new code.
Code:
xtomdl.exe /xanim /dict:..\..\bin\modeldef.xml /xmlsample %1 >"%~p1\%~n1_buildlog.txt"
 
I usually do this with MCX now. I drag .X file to the window of MCX and the model will show up. Then I process it such as Round World Correction, making LODs or modify material. Then export out from MCX to MDL. It is fast and convenient.
 
I think you have exported from different plugin. You need P3D SDK to export the model. I think your problem is 3dsmax --->export---->.X file not X.file to mdl
 
but why i get this error please help me :( and is the quality of 3d buildings and ground polygons better shows in fsx with max 3ds or gmax?
 
Not working.I downloaded prepar3d SDK and i tryed with 3DSM2015_x64 and send to XtoMDL and again the MDL is 0 bytes :/
 
http://prntscr.com/7pt902 there is an image of my error.No guidtoname set something like this..So i dont know how will you understand the text and look carrefully at it becouse it is transparency becouse i cant find my log file ..
 
Back
Top