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

MSFS MCX GDI+ Error Converting DDS to PNG

Messages
7,450
Country
us-illinois
Hi Arno:

I wanted to test Sketchup import of MSFS default 3D models sourced from a ModelLib BGL via MCX export of a glTF, to test the PBR 3D viewer cited here:



In MCX July 30, 2021 Build, I imported:

[MSFS-2020_Packages_Install_Path]\Official\OneStore\microsoft-airport-kfhr-friday-harbor\scenery\Microsoft\Friday-Harbor\modelLib.BGL


I exported from MCX: Object 29/30 (KFHR-05) as glTF 3D model, exited MCX, and then imported that new glTF 3D model into MCX

In MCX > Material Editor > {Textures} tab, I selected all mapped DDS textures, and attempted to export to PNG

I then (immediately) get a GDI+ error attempting to convert the already mapped DDS textures into PNG format

Is this something that MCX is 'intended' to do ? :scratchch


Thanks in advance for any info you could provide on intended MCX functionality for this process. :)

GaryGB
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,858
Country
netherlands
Hi Gary,

Does this happen with any texture or just a specific one? The GDI error probably comes from dotnet when trying to save the png file.
 
Messages
7,450
Country
us-illinois
If I select all mapped textures in > {Textures} tab list > GDI+ error

If I select only the texture at the top of {Textures} tab list > GDI+ error

(Sorry for my brevity - I'm on a phone mini-browser at this time)


GaryGB
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,858
Country
netherlands
OK, let me see if I can reproduce with a MSFS model.
 
Messages
7,450
Country
us-illinois
Hi Arno:

Since thus far, I am unable to get MCX Material Editor to retro-convert MSFS format *.DDS to *.PNG with no GDI+ error: :oops:

* How can I test whether MCX Material Editor successfully updated URI paths for mapped textures before the GDI+ error ?

Or does MCX not need to update URI paths (...because MCX' default uses file names only with no DDS or PNG file extension) ? :scratchch

https://www.fsdeveloper.com/forum/threads/gltf-support-for-modelconverterx.448834/post-855065


AFAIK, normally one's MCX work-flow may be:

MCX Material Editor > {Textures} Tab >:

* Texture Folder > { path field } [...] button > Browse for folder > select: { target folder name } > [OK] button

...manually directs URI path of converted / remapped texture image Materials into a \Texture sub-folder of a \PackageSources folder:


MSFS SDK FSPackageTool performs optimal DDS texture image Material format conversions from ex: 32-bit PNG (not JPG) file formats.


MCX Material Editor > {Textures} Tab > [Save Texture] button > click: 'down arrow' to access pull-down pick-list >:

* check: Ensure size power of two ...check-box

...and:

* check: Overwrite existing textures ...check-box

...then:

click: [Save Texture] button

...MCX updates 3D model ('URI' ? :scratchch ) path info, then re-maps- / knows to instead use- ...converted / re-mapped texture image Materials.

https://en.wikipedia.org/wiki/Uniform_Resource_Identifier

https://en.wikipedia.org/wiki/Percent-encoding


Of course in the work-flow cited above as a basis for inquiry in this thread, I attempted to convert MSFS DDS format to PNG. :pushpin:


As a work-around for the malfunctioning MCX Material Editor {Texture} tab work-flow, were you expecting us to instead: o_O

* Use MCX batch convert, after first creating / utilizing our own custom MCX Material Editor 'Templates' ?

* Manually convert mapped textures via graphics applications using NVidia / Intel MSFS-compatible (BCn/DXT) DDS I/O plugins ?





That said, I am not certain one could (...or should ? ) rely on any 3rd party graphics application using a currently available (BCn/DXT) DDS I/O plugin (other than MCX' "library"), to properly convert texture image Materials into new multiple compressed DXT DDS formats with optimized MIPMAPs utilized variably by MSFS 2020 SDK compilers. :alert:


Thanks for any updated info you are willing to share with us on this process to, hopefully enhance use of MCX for MSFS. :)

GaryGB
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,858
Country
netherlands
Gary, what is your point with this last post? I replied yesterday that I need to try to reproduce the bug you reported. So until I have done that I have no idea of work arounds either, as I have not looked at the issue yet.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,858
Country
netherlands
Gary,

I have just checked this issue, but I can't reproduce it on my machine. I can convert the MSFS textures to PNG files without any error. The PNG files are created in the selected output folder.

Do you have more details of the error you get, like a stack trace or so?
 
Messages
7,450
Country
us-illinois
Hi Arno:

I wanted to test Sketchup import of MSFS default 3D models sourced from a ModelLib BGL via MCX export of a glTF, to test the PBR 3D viewer cited here:



In MCX July 30, 2021 Build, I imported:

[MSFS-2020_Packages_Install_Path]\Official\OneStore\microsoft-airport-kfhr-friday-harbor\scenery\Microsoft\Friday-Harbor\modelLib.BGL


I exported from MCX: Object 29/30 (KFHR-05) as glTF 3D model, exited MCX, and then imported that new glTF 3D model into MCX

In MCX > Material Editor > {Textures} tab, I selected all mapped DDS textures, and attempted to export to PNG

I then (immediately) get a GDI+ error attempting to convert the already mapped DDS textures into PNG format

Is this something that MCX is 'intended' to do ? :scratchch


Thanks in advance for any info you could provide on intended MCX functionality for this process. :)

GaryGB

Gary,

I have just checked this issue, but I can't reproduce it on my machine. I can convert the MSFS textures to PNG files without any error. The PNG files are created in the selected output folder.

Do you have more details of the error you get, like a stack trace or so?

Hi Arno:

Many thanks again for testing this. :)

As I am not a coder, I was not certain what to do ...so that MCX Material Editor will work without the above cited error.

Will this info be adequate to troubleshoot what action may be necessary on this computer to restore full MCX functionality ? :oops:

Here is a copy of the MCX GDI+ error message details for attempted DDS to PNG conversion:

Code:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
   at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
   at ASToFra.TextureWriter.GenericWriter.Write(TextureImage tex, String filename, TextureFormatWrite format)
   at ASToFra.TextureWriter.AllTextureWriter.Write(TextureImage texture, String filename, TextureFormatWrite format)
   at ASToFra.ObjectEditor.TextureConverter.ConvertTexture(TextureImage texImage, TextureSize size, String outputPath, TextureFormatWrite outputFormat, String texName, Boolean overwriteExisting, String orgTexName)
   at ASToFra.ObjectEditor.TextureConverter.ConvertAllTextures(String outputPath, Boolean prefixTextureNames, String prefixString, Boolean overwriteExisting, Boolean requirePowerOfTwo, TextureFormatWrite outputFormat)
   at ASToFra.ModelConverterX.MaterialEditorForm.tlstiUpdateTextures_ButtonClick(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripSplitButton.OnButtonClick(EventArgs e)
   at System.Windows.Forms.ToolStripSplitButton.OnMouseUp(MouseEventArgs 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.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
ModelConverterX
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ModelConverterX.exe
----------------------------------------
ASToFra.ErrorHandler
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.ErrorHandler.DLL
----------------------------------------
ASToFra.Interfaces
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.Interfaces.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    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.8.4360.0 built by: NET48REL1LAST_C
    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.8.4390.0 built by: NET48REL1LAST_C
    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.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.Utils.DLL
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
    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.8.4390.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
ASToFra.ObjectModel3D
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.ObjectModel3D.DLL
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
ASToFra.ObjectReader
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.ObjectReader.DLL
----------------------------------------
ASToFra.ObjectWriter
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.ObjectWriter.DLL
----------------------------------------
ASToFra.EventLog
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.EventLog.DLL
----------------------------------------
ASToFra.ObjectRenderer
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.ObjectRenderer.DLL
----------------------------------------
OpenTK.GLControl
    Assembly Version: 3.1.0.0
    Win32 Version: 3.1.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/OpenTK.GLControl.DLL
----------------------------------------
OpenTK
    Assembly Version: 3.1.0.0
    Win32 Version: 3.1.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/OpenTK.DLL
----------------------------------------
ASToFra.ParticleEffects
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.ParticleEffects.DLL
----------------------------------------
Geometry
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/Geometry.DLL
----------------------------------------
ASToFra.FSUtils
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.FSUtils.DLL
----------------------------------------
ASToFra.LicenseHelper
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.LicenseHelper.DLL
----------------------------------------
Portable.Licensing
    Assembly Version: 1.0.0.0
    Win32 Version: 1.1.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/Portable.Licensing.DLL
----------------------------------------
ASToFra.TextureObject
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.TextureObject.DLL
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
ASToFra.TextureLoader
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.TextureLoader.DLL
----------------------------------------
Newtonsoft.Json
    Assembly Version: 12.0.0.0
    Win32 Version: 12.0.3.23909
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/Newtonsoft.Json.DLL
----------------------------------------
Microsoft.CSharp
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Dynamic
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
    Assembly Version: 0.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
AssimpNet
    Assembly Version: 5.0.0.0
    Win32 Version: 5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/AssimpNet.DLL
----------------------------------------
ASToFra.XPUtils
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.XPUtils.DLL
----------------------------------------
lib3ds.Net
    Assembly Version: 2.0.0.41170
    Win32 Version: 2.0.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/lib3ds.Net.DLL
----------------------------------------
pfim
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/pfim.DLL
----------------------------------------
ASToFra.ObjectEditor
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.ObjectEditor.DLL
----------------------------------------
System.Drawing.Design
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4200.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.Design.dll
----------------------------------------
System.Design
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
ASToFra.TextureWriter
    Assembly Version: 1.0.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///D:/Arno_MCX_%2007-30-2021/ASToFra.TextureWriter.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


PS: I found this in a Google search:


Does MCX (Run @ Admin privileges) still need "special" permissions to write into a MSFS default "Package" \Texture sub-folder ? :scratchch


Or is there a "new" MCX dependency other than .NET 4.7.2 for a "new" MCX library to inter-convert (BCn/DXT) DDS and PNG ? :duck:


FYI: My installed .NET version is: 4.8.04084 :pushpin:

https://www.windowscentral.com/how-...rk-version-windows-10#dotnet_version_registry

GaryGB
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,858
Country
netherlands
Hi,

From that page you linked to it sounds like permissions might be the issue.

I have no problems writing to the package folder myself (I just tried) and I never run MCX as admin either. But I did install my MSFS files in C:\MSFS and not inside the program files folder structure. So that might be part of the difference.
 
Messages
7,450
Country
us-illinois
If I 'give access' with Read/Write & special permissions to (all) users on my Windows 10 Pro 64-Bit computer ...for this D: drive sub-folder:

D:\MSFS-2020_Packages_July-27-2021\Official\OneStore\microsoft-airport-kfhr-friday-harbor\scenery\Microsoft\Friday-Harbor\TEXTURE

...and I still get the above cited MCX Material Editor GDI+ error, what must I do to give unrestricted write access to MCX ? :scratchch

GaryGB
 
Last edited:
Messages
7,450
Country
us-illinois
Hi Arno:

I made a copy of the above test package folder chain:

D:\MSFS-2020_Packages_July-27-2021\Official\OneStore\microsoft-airport-kfhr-friday-harbor\

...and pasted it into:

C:\Users\[username]\Downloads folder

This time, I did NOT get the above cited MCX Material Editor GDI+ error. :cool:


Apparently there is still a Windows permissions access lock on the above MSFS packages sub-folder in question. :scratchch

But at least now I am able to do some of the testing I originally intended to do above.


Many thanks again for looking into this, and for helping to troubleshoot this curious MCX functionality on my Win-10 installation. :)

GaryGB
 
Last edited:
Top