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

Blender XtoMDL exporting to .x/MDL files

Messages
92
Country
unitedkingdom
Hi Guys,

I know it's been awhile but I'm having issues exporting into .x/MDL files from Blender. I've reinstalled the FSX/P3D toolset and also reinstalled Blender 2.9.11 as well as the P3D v1.4 SDK. i'm sure I've sorted this out before but i've recently updated my systems to Win 11 etc.

If I export to .x file only I can get a successful operation but I am unable to open the file in MCX, Here's the export info and System Console on an unsuccessful export. hoping you can point me in the right direction. The file is a simple cube (the starting scene for blender

INFO PANEL
Python: Traceback (most recent call last):
File "C:\Users\natha\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Blender2P3DFSX\func_export.py", line 351, in Export
spawnv(P_WAIT, XToMdl, ['XToMdl.exe', additional, '"%s"' % (Util.ReplaceFileNameExt(self.config.filepath, '.x'))])
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\natha\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Blender2P3DFSX\ui_export.py", line 204, in execute
Exporter.Export()
File "C:\Users\natha\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Blender2P3DFSX\func_export.py", line 357, in Export
raise ExportError("Export to .MDL failed. XToMdl.exe returned an error.")
Blender2P3DFSX.li_export.ExportError: Export to .MDL failed. XToMdl.exe returned an error.

location: <unknown location>:-1

CONSOLE
======================================================================================================
Blender P3D/FSX Toolset version (0, 98, 34)
======================================================================================================

Original Toolkit developed by: Felix Owono-Ateba, 2014
Updated for Prepar3D by Ron Haertel
Modifications by Kris Pyatt, 2017
and Manochvarma Raman, 2018
Modified for Blender 2.8x by Otmar Nitsche, 2020
Copyright resides with the authors.

This program comes with NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see source files for details.

======================================================================================================
Using modeldef from:
C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Modeling SDK\3DSM7\modeldef.xml
Exporting scene to:
C:\Users\natha\Desktop\cube.x
Export log file under:
C:\Users\natha\Desktop\cube-log.txt
======================================================================================================

Gathering top-level objects from scene...
Progress: : [####################] 100% DONE
All top-level objects from scene gathered.

Gathering child objects from scene...
Progress: : [####################] 100% DONE
All child objects from scene gathered.

Export list complete.

Writing header to X-file
Writing GUID to X-file
Outlining hierarchy in X-file

Writing geometry information...
Progress: : [####################] 100% DONE
Finished writing geometry information. Closing file.


======================================================================================================
Creating MDL file

SDK root directory:
C:\Program Files (x86)\Lockheed Martin\Prepar3D SDK 1.4.4747.0\
XtoMdl.exe path:
C:\Program Files (x86)\Lockheed Martin\Prepar3D SDK 1.4.4747.0\\Environment Kit\Modeling SDK\3DSM7\Plugins\XToMdl.exe
======================================================================================================

XToMdl.exe (C) Microsoft
The following output is generated by the tool XToMdl.exe.
This tool is provided with your P3D/FSX SDK and is in no way
related to Blender2P3D/FSX author(s), except by its use here.*

======================================================================================================

****************** Begin of XtoMdl.exe output ******************
OutputFile: C:\Users\natha\Desktop\cube.MDL
Output file after modification: C:\Users\natha\Desktop\cube.MDL
Creating output MDL file: C:\Users\natha\Desktop\cube.MDL
error : Error loading .X file: (C:\Users\natha\Desktop\cube.x). Is it a valid FLIGHT SIMULATOR '.X' file?
(0): error : XToMdl.exe Unhandled Application Exception
(0): error : SlimDX.Direct3D9.Direct3D9Exception: D3DXFERR_FILENOTFOUND: File not found (-2005531767)
(0): error : at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
(0): error : at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
(0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
(0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
(0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
(0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
(0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
(0): error :
(0): error : D3DXFERR_FILENOTFOUND: File not found (-2005531767)
(0): error :
(0): error : Stack Trace:
(0): error : at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
(0): error : at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
(0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
(0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
(0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
(0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
(0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
Export to MDL failed. Please check the console for details.
Python: Traceback (most recent call last):
File "C:\Users\natha\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Blender2P3DFSX\func_export.py", line 351, in Export
spawnv(P_WAIT, XToMdl, ['XToMdl.exe', additional, '"%s"' % (Util.ReplaceFileNameExt(self.config.filepath, '.x'))])
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\natha\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Blender2P3DFSX\ui_export.py", line 204, in execute
Exporter.Export()
File "C:\Users\natha\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Blender2P3DFSX\func_export.py", line 357, in Export
raise ExportError("Export to .MDL failed. XToMdl.exe returned an error.")
Blender2P3DFSX.li_export.ExportError: Export to .MDL failed. XToMdl.exe returned an error.

location: <unknown location>:-1
 
1st, have you installed DirectX v9.0c? This is required for FSX & the SDK.

2nd, What was the order of installing after blender. Did you install the SDK before the toolset?

3rd, Was the toolset initialized before?
 
Last edited:
I've made no changes to the OS or file systems following updates to Win11 - however I can redo it all again, because I honestly can't remember..... worth a shot i guess

I've just spotted the DXD error - fresh eyes I'll reinstall DirectX 9.0c
 
Last edited:
Back
Top