• 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.

Using a Batch file to run the xtomdl.exe

Messages
290
Country
germany
Hi,

i normaly use a batch-file to run the xtomdl.exe, cause it is easyer the running the cmd all the time ;)

Now im starting to deal with more and more model and i tought... why not make it easyer again.

What im planing is to use a single .bat and just change the name of it to match the .x-file name, then execute it.

The batch has the name XXXX_xtomdl.bat, where ill just interchange the XXXX to match the name of the .x-file that I want to process.
For that i know that the command "tokens=1 delims=_" needs to be used, but how???... a 'FOR'-command?... i just dont know.

So again in short.

-I start the XXXX_xtomdl.bat
-it looks for the 1. tocken bevor the _
-it writes the content of the token to the var %f
-it exutes the following line:
XtoMdl.exe /XANIM /DICT:..\..\bin\modeldef.xml %f.x

Thats the plan, so i only need to change XXXX of the bat.

Somebody still into BATCH code?
 
I don't know why this will be easier - you will have to have a different batch file for each model, and if you do that, you might as well just hardcode the name into the batch file and save all the fiddling around. Or, you could put xtomdl on your right click send to menu.
 
Or simply use a %1 to parse filenames from the bat to XtoMdl.exe and drop your x files on it.

Sadly Wildcards don't work, but you could probably select multiple x files and drop them all on.


---
- Sent from my mobile .. words substituted by iPhone at will.
 
A quick search for MS-DOS commands lead me to this website and the FOR command.

It's been a very long time since I last used DOS for anything over than copying files from one DIR to another.

Hope this helps.

David
 
In Maya (3D) I’ve made a small script that launches the .bat and copies the .mdl to the appropriate FSX folder.
All the name strings are stored with the 3d model in the Maya source file.
So when I load an aircraft model it knows: what its name is, what flags it uses, and where it goes after export :)

A single click to export-build-copy means conserving a lot of mental energy.
And I have none of that to spare ;)

I think this could be done in Max script too...
Max should have a script command that lets you launch a .bat file.

...
 
Last edited:
I think this could be done in Max script too...
Max should have a script command that lets you launch a .bat file.

It would still remain a two-step process.

1. Export from Max to .x & .xanim files
2. Run a Maxscript to execute a .bat file

Given that, it's still easiest (IMHO) to simply right-click on the .x file and choose SendTo "Compile Aircraft" and be done with it. That's why I wrote the Wiki entry describing how to set up the Shortcut and put it in the ..\SendTo folder:
http://www.fsdeveloper.com/wiki/index.php?title=XtoMDL

The compiled .mdl file will magically appear in the same folder as the source .x file...

...which is precisely why I export the .x file directly to the aircraft's ..\Model folder, or in the case of scenery to the ..\Addon Scenery\MyScenery\scenery folder...
 
Last edited:
It would still remain a two-step process.

1. Export from Max to .x & .xanim files
2. Run a Maxscript to execute a .bat file

It's just one step...Maya (or Max) script can manage all the exports as well.

Press Button
-Select content
-Export selected
-Export Anim
-Run XToMdl.exe
-Copy to folder
-Report Errors

All the req'd data fields are in a hidden node in the model file.
It basically a config...you set once...or edit as req'd

But your method takes much less setup time.
A max script would take a few hours to a week to make.

Danny
 
Last edited:
outch... i didnt though about that.. ok that makes it realy easy cause i can add parameters to the LINK

READ the Wiki article I wrote and make things really so much easier on yourself... ;)
 
Yeah, I should have ^^

But its typical, i looked in the documentation in the SDK about xtomdl, nearly all my questions where covered.
The "problem" with starting the xtomdl was more like a generell thing, not special to the xtomdl, so why look in the wiki?

Maybe a "hot"-topics or must-read section would help newbies.
 
.... so why look in the wiki?

Because that's where lots of answers are!

In all seriousness, unless you are trying to Run Max under Red Hat, using some bizarre conversion process that no-one has ever seen before and running a version of XtoMdl.exe that you wrote yourself .... chances are that someone, somewhere has encountered and solved the problem you have met.

That was, after all, why you asked ..... :D
 
Back
Top