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

MCX latest development release: Problems when isolating parts and exporting

Heretic

Resource contributor
Messages
6,830
Country
germany
MCX' latest development release (Sept. 18th, 2018) essentially crashes when trying to delete or isolate parts from a hierarchy and refuses to export.

1)
- Open a FSX MDL file in MCX.
- Search for a certain part in the hierarchy editor
- Select part from list and press "isolate"
Result: MCX shows the following unhandled exception

Code:
************** Exception Text **************
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at ASToFra.ObjectRenderer.Renderer3DHandlerType.FillArrayObjects()
   at ASToFra.ObjectRenderer.Renderer3DHandlerType.GenerateArrays()
   at ASToFra.ObjectRenderer.Renderer3DHandlerType.SetObjectModel(ObjectModel newObj, ObjectChangeLevel level)
   at ASToFra.ObjectRenderer.Renderer3DControl.OnObjectChanged(ObjectChangeLevel level, ObjectModel obj, Object sender, String changeDescription)
   at ASToFra.Interfaces.ObjectChanged.Invoke(ObjectChangeLevel level, ObjectModel obj, Object sender, String changeDescription)
   at ASToFra.Interfaces.EventDistributor.RaiseObjectChanged(ObjectChangeLevel level, ObjectModel obj, Object sender, String changeDescription)
   at ASToFra.ModelConverterX.HierarchyEditor.RaiseObjectChanged(ObjectChangeLevel level, String message)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3163.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
ModelConverterX
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ModelConverterX.exe
----------------------------------------
ASToFra.ErrorHandler
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.ErrorHandler.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3151.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
ASToFra.Utils
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.Utils.DLL
----------------------------------------
ASToFra.Interfaces
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.Interfaces.DLL
----------------------------------------
ASToFra.ObjectModel3D
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.ObjectModel3D.DLL
----------------------------------------
ASToFra.ObjectReader
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.ObjectReader.DLL
----------------------------------------
ASToFra.ObjectWriter
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.ObjectWriter.DLL
----------------------------------------
ASToFra.EventLog
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.EventLog.DLL
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3160.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
ASToFra.ObjectRenderer
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.ObjectRenderer.DLL
----------------------------------------
CSGL12DLL
    Assembly Version: 12.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/CSGL12DLL.DLL
----------------------------------------
ASToFra.ParticleEffects
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.ParticleEffects.DLL
----------------------------------------
ASToFra.FSUtils
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.FSUtils.DLL
----------------------------------------
ASToFra.TextureObject
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.TextureObject.DLL
----------------------------------------
lib3ds.Net
    Assembly Version: 2.0.0.36005
    Win32 Version: 2.0.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/lib3ds.Net.DLL
----------------------------------------
ASToFra.TextureLoader
    Assembly Version: 1.0.0.0
    Win32 Version: 1.4.0.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ASToFra.TextureLoader.DLL
----------------------------------------
MonoGame.Framework
    Assembly Version: 3.4.0.459
    Win32 Version: 3.4.0.459
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/MonoGame.Framework.DLL
----------------------------------------
System.Design
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
ObjectListView
    Assembly Version: 2.9.1.25410
    Win32 Version: 2.9.1.0
    CodeBase: file:///E:/Dev%20Utilities/Model%20Converter%20X/ObjectListView.DLL

This only seems to affect items whose "SceneGraphNode" parent wold be deleted.
Deleting a single "SceneGraphNode" and "ModelPart" together also produces the error.
Deleting a "ModelPart" without touching the "SceneGraphNode" seems to work most of the times.



2)
Exporting a FSX MDL file does not work. Log entry:

Code:
23:32    MDLXWriter    Information    Starting writing of file V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\test2.mdl
23:32    MDLXWriter    Information    Object contains animations
23:32    XWriter    Information    Starting writing of file V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\tmp37C.x
23:33    XWriter    Information    Finished writing of file V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\tmp37C.x
23:33    XtoMDL    Information    Found dictionary file: V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\MCX_ModelDef.xml
23:33    XtoMDL    Information    Found output file: V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\test2.mdl
23:33    XtoMDL    Information    OutputFile: V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\test2.mdl
23:33    XtoMDL    Information    Output file after modification: V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\test2.mdl
23:33    XtoMDL    Information    Creating output MDL file: V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\test2.mdl
23:33    XtoMDL    Error        error : Error loading .X file: (V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\tmp37C.x).  Is it a valid FLIGHT SIMULATOR '.X' file?
23:33    XtoMDL    Error        (0): error : XToMdl.exe Unhandled Application Exception
23:33    XtoMDL    Error        (0): error : SlimDX.Direct3D9.Direct3D9Exception: D3DXFERR_PARSEERROR: Parse error (-2005531760)
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
23:33    XtoMDL    Error        (0): error :
23:33    XtoMDL    Error        (0): error : D3DXFERR_PARSEERROR: Parse error (-2005531760)
23:33    XtoMDL    Error        (0): error :
23:33    XtoMDL    Error        (0): error : Stack Trace:
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
23:33    XtoMDL    Error        (0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
23:33    MDLXWriter    Information    Finished writing of file V:\X-Plane 11\Aircraft\Development\Aero L-39C Albatros - Modded\0_Resources\FSX Export\test2.mdl

Apparently, this is a problem with finding XToMDL, but the path is correct. Yet, neither the XToMDL from the FSX nor the one from the P3Dv1.4 SDK works.



Maybe I'm just overlooking something. It's been a long, long while since I last used MCX in earnest.
 
Last edited:
Hi,

I didn't change anything recently in the hierarchy editor, but I'll try to reproduce this.

About the exporting, are you sure there are no attachpoints or textures with weird names? That can cause issues in loading the X file.
 
I don't think that the hierarchy editor bug is recent, but I'm not really sure.


Issue number two was due to "Color[number]" materials that, for some reason, were set to "default transparent" (alpha-based blend modes). After having set them to "default opaque", the export worked flawlessly.
This might be a general XToMDL bug, regardless of version (tried with FSX and P3Dv1), so it could be worth implementing an automated check during export.
 
Do you know which specific material attribute have the problem? Then I can check that.
 
Do you know which specific material attribute have the problem? Then I can check that.

It's the framebuffer blend modes for transparencies. "Zero/One" (for "Destination/Source") work fine, while "InvSrcAlpha/SrcAlpha" crash the exporter.
 
Thanks, let me check.
 
Hi,

I tried the isolate function with a few models, but I can't reproduce the error when isolating any modelpart or scenegraphnode. Anything specific in the model when you have the crash?
 
And I can't reproduce the crash with the blend mode setting for colored materials either. If I set a material with only a color to the default transparent, it compiles here on my machine.
 
That's weird.

I've sent you a PM with the MDL file so you can take a firsthand look.
 
Thanks, I'll try to reproduce it with that file. Hopefully I get the issue then.
 
Hi,

I still can't reproduce the isolate issue with that file. It works like a charm here :)

I can reproduce the issue with the xtomdl crash, but it is not due to the material settings. It seems a NaN value is in the X file. When the material template is applied to set the material to opaque the model is optimized and that seems to filter out the part with the issue. So I need to check where those NaN values come from.
 
I still can't reproduce the isolate issue with that file. It works like a charm here :)

Try isolating multiple parts at once.
E.g: Search for "aileron", select at least two of the four results, press "isolate" and you'll get the error.

I can reproduce the issue with the xtomdl crash, but it is not due to the material settings. It seems a NaN value is in the X file. When the material template is applied to set the material to opaque the model is optimized and that seems to filter out the part with the issue. So I need to check where those NaN values come from.

Well, the model was exported from GMax with the FSX gamepack, but GMax' exporter deletes the X files immediately after compiling, so I sadly can't trace anything back.
 
Try isolating multiple parts at once.
E.g: Search for "aileron", select at least two of the four results, press "isolate" and you'll get the error.

I'll give that a try tonight.

Well, the model was exported from GMax with the FSX gamepack, but GMax' exporter deletes the X files immediately after compiling, so I sadly can't trace anything back.

I think it is more likely that MCX somewhere introduced this problem. I'll continue to debug this evening.
 
I have fixed the NaN issue now, it was in the logic to remove scaling.

I can reproduce the isolate crash as well now, I think the search was a crucial element. Trying to understand what happens now.
 
I have fixed the crash as well now. The problem only happened if you selected multiple nodes and if some of these nodes were the child of other selected nodes. That caused the same node to be added twice, since all children of a selected node are carried over already.

The new development release with both fixes should be online in about 20 minutes or so.

Thanks for reporting the issues!
 
Back
Top