1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FSXA New GDI error

Discussion in 'ModelConverterX' started by Pyscen, 18/6/10.

  1. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    Hello Arno,...

    Got a new Error (with latest version; release date: today 579 update),.. placing dds files in diffuse slot. Not sure if that was the cause. Here is what came up though:

    Unhandled exception has occurred in your application....


    ************** Exception Text **************
    System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
    at System.Drawing.Image.RotateFlip(RotateFlipType rotateFlipType)
    at ASToFra.TextureImage.get_Image()
    at ASToFra.MaterialEditorForm.SetTexturePreview()
    at ASToFra.MaterialEditorForm.listBox1_SelectedIndexChanged(Object sender, EventArgs e)
    at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
    at System.Windows.Forms.ListBox.WmReflectCommand(Message& m)
    at System.Windows.Forms.ListBox.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3607 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    ModelConverterX
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/ModelConverterX.exe
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    ObjectWriter
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/ObjectWriter.DLL
    ----------------------------------------
    TextureObject
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/TextureObject.DLL
    ----------------------------------------
    ObjectModel3D
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/ObjectModel3D.DLL
    ----------------------------------------
    ObjectRenderer
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/ObjectRenderer.DLL
    ----------------------------------------
    GRV11DLL
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/GRV11DLL.DLL
    ----------------------------------------
    ObjectReader
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/ObjectReader.DLL
    ----------------------------------------
    TextureLoader
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/TextureLoader.DLL
    ----------------------------------------
    ObjectEditor
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/ObjectEditor.DLL
    ----------------------------------------
    System.Design
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Design/2.0.0.0__b03f5f7f11d50a3a/System.Design.dll
    ----------------------------------------
    System.Drawing.Design
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing.Design/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.Design.dll
    ----------------------------------------
    Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    TextureWriter
    Assembly Version: 1.0.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Program%20Files/FS%20Design%20Tools/ModelConverterX/TextureWriter.DLL
    ----------------------------------------
  2. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,304
    Country:
    netherlands
    Hi,

    It seems I can not reproduce it here by assigning any DDS file to a diffuse texture slot. Does it happen only with that one texture or with multiple?
  3. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    happens on multiple number of them (textures), not any specific texture,... rebooted and it did it again.
  4. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,304
    Country:
    netherlands
    Hi Doug,

    Could you maybe send me the model and textures so that I can try with the same conditions? Without being able to reproduce the problem it will be hard to fix it.
  5. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    yes that would not be a problem... let me zip it up and you want me to send to you to what address?
  6. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    I sent the Project to you to determine what is happening... hopefully it will help....
  7. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,304
    Country:
    netherlands
    Thanks, got them. I'll take a look and see if I can reproduce the problems.
  8. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,304
    Country:
    netherlands
    Hi,

    At the moment I can not yet reproduce the error. I will try again later.
  9. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    I don't know if this is a factor, but.. I'm using Windows XP. Maybe a different handling to the problem.
  10. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    Arno

    Well,... What I have done to get around it somewhat, mind you, is by placing all the diffused slot with the designated dds file (texture). Then, loaded up the MDL file and went in to add the others in their desiginated spots. When I started adding the Ambient, Diffuse, and Specular colors then resaved the MDL I get a bunch of warning info comments like this:

    9:07 PM XtoMDL Information warning : Degenerate poly detected in file (C:\Documents and Settings\Pumpkin\My Documents\Google SketchUp Models\KDAL Project\KDAL Terminal\KDAL_Term\KDAL_Term.x) mesh (Part2)
    9:07 PM XtoMDL Information warning : Face vertex 0 x=-39.40745 y=18.89167 z=7.41634
    9:07 PM XtoMDL Information warning : Face vertex 1 x=-49.2469 y=18.89167 z=7.41634
    9:07 PM XtoMDL Information warning : Face vertex 2 x=30.20828 y=18.89167 z=7.41634


    I'm sure what's being asked for me to correct?

    Never seen this before
  11. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,459
    Country:
    unitedstates
    Don't worry about "Degenerate" polys. They won't affect the appearance usually. What it means is the same thing "colocated vertices" meant in FS9 modeling.

    Two vertices with the same exact coordinates (or within 1mm at least).
  12. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    Well thats good to know... The only thing that concerns me, I later realized that the colors for Ambient, Diffuse, and Specular were not being saved within the model file also... I'm not sure whats causing the problems... If Arno is unable to produce the same problem, I'm at a lost. The only thing I can think of is maybe a XP/Vista/Windows 7 differences (memory handling, filename usage etc).
  13. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,304
    Country:
    netherlands
    Hi,

    I will take a look. ModelConverterX is supposed to filter out such polygons that have no area. It seems that for your object this might not be working.

    In the FSX MDL format the colours should be saved as well. I have to check, maybe when there is a texture as well ModelConverterX modifies the colours (like the gamepack also does). I will have to check the code for this.
  14. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,304
    Country:
    netherlands
    Hi Doug,

    Can you explain a bit more about your problem with the colours? I tried it and ModelConverterX saves the diffuse and specular colour correctly. The FSX MDL format does not store the ambient or emmissive colour, so these are not kept. But that is a limitation of the MDL format.
  15. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    ok... That would explain it,... I was changing the ambient color,... and if it doesn't keep that then that part is fine then... It was specifically the Ambient color that wasn't kept or saved.

    On the memory handling: It appears that it occurs after you have opened and closed the material editor multiple times (to see what has been done or not), since the texture names don't change unless you do so (one of the previous problems mentioned before). I noticed that if I go down the texture list within the material editor, it doesn't seem to have a problem.. as long as I don't close and reopen the material editor as much. Also, alot has to do with the size of the textures too I think... I have played with the sizes on the textures and it does seem to help,... though on FSX textures I don't want to change those sizes since it could affect the default buildings (which I have found out) :)

    I guess on the memory handling I need more memory or make smaller models (building), though it would make it harder to build terminals specifically.

    Just a question Arno,... Does ModelConverterX use any of the paging memory functionality of Windows (any)?
  16. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    Arno,... just to clarify,... on the Ambient color not being stored in a MDL file: Are you saying that if I load a mdl in MCX and try to change the ambient color it would not resave back into the same mdl file? Because that what I was doing. Now, if I loaded a dae file, and changed a ambient color there,... then exported it to a mdl, it appears to be saving within the mdl file. Is this what you were referring? That is does resave back into a mdl file?
  17. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,304
    Country:
    netherlands
    Hi Doug,

    OK, I will give that a try. The size of the texture will probably have an influence since the bigger the texture the more memory it needs. But I intended the make ModelConverterX so that each texture is only loaded once. I will check the memory leak again.

    Not sure what you mean by this. ModelConverterX is made using .NET, but I have not especially used any paging functionality.

    The FSX MDL file does not even store an ambient or emissive colour. So when you read the MDL ModelConverterX will define the value for you (black for the emissive colour, the diffuse colour for ambient). When exporting the value is ignored.

    The FS2004 MDL format can store all four colour types, that is why the material editor lists them all.
  18. Pyscen

    Pyscen

    Joined:
    13/8/06
    Messages:
    709
    Country:
    us-texas
    Ok,... that would be great! Sorry for the difficulties ;)

    Well,... I would think that the .NET (since written by Microsoft) it would incorporate that part of memory handling within the system. In general terms, when not enough memory available, the system would dump to disk (virtual memory) until needed.

    ok... I got it now... makes sense in what I'm seeing. :)

    Thanks again Arno!!

Share This Page