Author Topic: FS AI aircraft texture checker (New version 1.45)  (Read 38678 times)

0 Members and 1 Guest are viewing this topic.

Offline ewerber

  • Turbine Captain
  • *****
  • Posts: 567
    • FSXAIBureau
FS AI aircraft texture checker (New version 1.45)
« on: January 27, 2012, 08:13:34 AM »
NEW VERSION 1.45! see below

Hello,
I am happy to present a little tool I coded in C# that should help an AI enthusiast with tracking down those pesky repaints who show up as grey models or even crash the simulator.
Basically what the tool does is to iterate over your aircraft folder and check each model for its texture file names then it checks if the texture folder that uses that model have the necessary texture files in it.
NEW in Version 1.4 the tool now actually checks the internal structure of the BMP files and tries to detect common texture faults which may lead to shutters or even outright crashes.

A few things,
1. Both FS9 models and FSX models are supported, therefor you can point the tool to your FS9 aircraft folder or any FSX simobjects folder and get a list
2. The tool doesn't fix file names or modify any file in your FS installation or your computer
3. The tool checks that the texture files specified in a .mdl file exist in the associated repaint texture folder and the global FSX/FS9 texture folder
4. The tool checks the bitmap format is correct for use in Flight Simulator X/9.
4. The tool only checks AI airplanes (specifically those that don't have a panel folder in them)
5. There might be security exception issues if your FS is installed inside the "program files" folder, try to run the tool as admin
6. There are probably some bugs left, post here if you have any issues

how to use:
1. Unpack the exe file anywhere you want.
2. Start program.
3. Click the "." button to browse for your FS aircraft folder (not your FS root folder) or input the path yourself into the text box.
4. Click start and wait.
5. When finished the tool will display the list of aircraft and corresponding texture folder names where the texture have issues.
6. You must save the log to get more detailed information regarding the errors found.

Some legal stuff,
This is freeware to be uploaded to other site only by the original creator and is provided as is, don't come to me if your computer explodes  :nuke:

Note: this tool requires all the latest .NET frameworks from MS.

Any bug reports, suggestions and feature requests? post here.

change log:

Version 1.45 NEW
1. Opss broken FS9 support in last version, fixed.

Version 1.44
1. If texture.cfg file pointed to another folder all BMP's there would get checked regardless if they were used by the model, now only BMP's used by the model are checked.
2. The same number 2 from below except this time it works.

Version 1.43
1. Fixed a bug that could crash the tool with improper texture.cfg files
2. Tool now detects BMP textures for native FSX models specifying DDS textures in their MDL.

Version 1.42
1. Added support for texture.cfg when using FSX.

Version 1.41
1. Fixed a bug that prevented some texture files which did not have an alpha channel but were DXT3 compressed from being detected as bad textures.

Version 1.4
1. The tool now checks every BMP file to see its structure is correct for use in FSX/FS9. here are the new errors you may encounter in your log and suggestions on what to do about them:
a. Bitmap is not of FS valid bitmap type (most likely 32bit saved directly in Photoshop) and is therefore considered invalid ---> open file in imagetool/DXTBMP and resave as 32bit or DXT1/3/5 according to your preference.
b. Bitmap Color planes must be 1 but was :#. bitmap is invalid ---> should never ever happen but if it does the file is most likely not a bitmap file but something else that was renamed to bmp.
c. Unknown Bitmap compression detected: #### . bitmap is invalid ---> should also not happen, if it does try to open the bmp in imagetool/DXTBMP and resave.
d. Missing FS info in bitmap header, bitmap is invalid ---> this bmp might have been saved in a special bmp scheme but its not meant for Flight Simulator.
e. Unknown alpha type encountered and bitmap compression is DXT3/5, shuttering may occur ---> a well known problem with DXT3/5 texture who are missing the alpha channel flag and will cause shuttering, either run DXT3Fixer or import white alpha into the bmp using DXTBMP.
f. Incorrect texture dimensions encountered. ---> If the textures are of incorrect size or the size is not a power of 2 etc this error will display, in this case the repaint has something seriously wrong with it and you will need to contact the painter.
2. if you are using FS9 the tool will also check you haven't accidentally installed FSX textures (DXT5 or larger then 1024px) into your FS9, these will cause nasty CTD's when the AI aircraft using them come into view.

Version 1.3
1. Fixed a bug that caused the "Entire texture folder is missing" to display when the folder in fact exists but none of the textures inside match the model.
2. Added support for DDS when in FSX mode, now either a .BMP or a .DDS will satisfy the program as an existing and correctly named texture, note that a missing texture will always be displayed with the BMP extension in the log unless the model has specified DDS textures only.

Version 1.22
1. Fixed a bug where some very old models would cause an unhanded exception, you can now choose to also get
a list of unsupported models in the log though this will just clutter the log so the default behavior is to ignore unsupported models.

Version 1.21
1. While the program was aware of the global texture folder it didn't list all the needed texture files, this has now been fixed.


Version 1.2
1. Fixed a bug regrading missing model or texture folders. as a result the program now gained some more functionality and will now also inform you if an entire texture folder is missing (or perhaps misspelled in the aircraft.cfg)
as well as missing model folders which will result in invisible AI aircraft in FS, all are now reported in the log file.

Version 1.1
1. Fixed: out of range exception in model texture parsing code (sorry about that needed to test it with some heftier none AI models to replicate the issue on my system)
2. you now get exact missing texture name rather than a simple texture folder, however to see texture file names you will need to save the log file. see next item
3. The tool now checks all textures a model requires exists, before it checked existing textures against the model. this caused all sorts of false positives so I changed it.
If a texture is in the log it means its inside the model and doesn't exist in the texture folder or the main FS texture folder where some AI model makers told you to put certain light map textures etc.
4. you now need to select your FS version from a drop down box, I also assume you have your FSX AI planes in a sub directory of simObjects. you still need to select your aircraft directory directly rather than your FS root folder.
5. Exclude list!, you can now specify texture name you want the tool to skip. these texture will be regarded as not missing not matter what. you can enter partial words or full texture name separated by a semi-colon.
I recommend you keep the default exclusions I  put in the list to prevent a bunch of false positives because of for example _D damage textures, a relic from CFS.
6. Settings are now saved in the same folder the tool is run from in a file called settings.cfg, any value you change in the tool is saved when you quit. the error log is only saved if you click the save button.

Version 1.0
1. Initial release
« Last Edit: April 05, 2013, 05:14:37 PM by ewerber »
Erez Werber,
FSXAIBureau.com

Offline kaese2002

  • Command Captain
  • *******
  • Posts: 1053
    • www.kaese2002.de
Re: Hunting down those problematic repaints that dont show any texture
« Reply #1 on: January 27, 2012, 10:42:39 AM »
great idea...tried it...but crashes after 2 sec searching

Code: [Select]
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.IndexOutOfRangeException: Der Index war auÃ?erhalb des Arraybereichs.
   bei FSTextureChecker.FSModel..ctor(String name, DirectoryInfo model)
   bei FSTextureChecker.Form1.btnCmdStart_Click(Object sender, EventArgs e)
   bei System.Windows.Forms.Control.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
   bei System.Windows.Forms.Button.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.4963 (win7RTMGDR.050727-4900).
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll.
----------------------------------------
FSTextureChecker
    Assembly-Version: 1.0.0.0.
    Win32-Version: 1.0.0.0.
    CodeBase: file:///E:/Flight%20Simulator%209/FSTextureChecker.exe.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.4961 (win7RTMGDR.050727-4900).
    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.4962 (win7RTMGDR.050727-4900).
    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.4927 (NetFXspW7.050727-4900).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.4963 (win7RTMGDR.050727-4900).
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.4927 (NetFXspW7.050727-4900).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------

************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.

Zum Beispiel:

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

Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten
Ausnahmen an den JIT-Debugger gesendet, der auf dem
Computer registriert ist, und nicht in diesem Dialogfeld behandelt.

Offline Sloeber

  • Senior Captain
  • ******
  • Posts: 840
  • Get you Sh** and get out!
Re: Hunting down those problematic repaints that dont show any texture
« Reply #2 on: January 27, 2012, 12:08:14 PM »
Crashed with me too.. about halfway through..
Code: [Select]

Zie het einde van dit bericht voor meer informatie over het aanroepen
van JIT-foutopsporing (Just In Time) in plaats van dit dialoogvenster.

************** Tekst van uitzondering **************
System.IndexOutOfRangeException: De index ligt buiten de matrixgrenzen.
   bij FSTextureChecker.FSModel..ctor(String name, DirectoryInfo model)
   bij FSTextureChecker.Form1.btnCmdStart_Click(Object sender, EventArgs e)
   bij System.Windows.Forms.Control.OnClick(EventArgs e)
   bij System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   bij System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bij System.Windows.Forms.Control.WndProc(Message& m)
   bij System.Windows.Forms.ButtonBase.WndProc(Message& m)
   bij System.Windows.Forms.Button.WndProc(Message& m)
   bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladen assembly's **************
mscorlib
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.5448 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
FSTextureChecker
    Assembly-versie: 1.0.0.0
    Win32-versie: 1.0.0.0
    CodeBase: file:///E:/Flight%20Simulator%209/Aircraft/FSTextureChecker.exe
----------------------------------------
System.Windows.Forms
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.5446 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.5447 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
mscorlib.resources
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.5448 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows.Forms.resources
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_nl_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** JIT-foutopsporing **************
Als u JIT-foutopsporing wilt inschakelen, moet in het configuratiebestand voor deze
toepassing of computer (machine.config) de waarde
jitDebugging in het gedeelte system.windows.forms zijn ingesteld.
De toepassing moet ook zijn gecompileerd terwijl foutopsporing
was ingeschakeld.

Bijvoorbeeld:

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

Wanneer JIT-foutopsporing is ingeschakeld, worden onverwerkte uitzonderingen
naar het JIT-foutopsporingsprogramma gestuurd dat op de computer is geregistreerd
en worden niet door dit dialoogvenster verwerkt.

The first time I tried it, it crashed too, as it could not find textures in a subdirectory (my own stupid mistake I guess, the texture dir was there, but it was divided in DXT3 and 32bit subdirs too)
The code above is the error on the second try.
Beam me up Scotty, there's no Intelligent life down here!

Offline kaese2002

  • Command Captain
  • *******
  • Posts: 1053
    • www.kaese2002.de
Re: Hunting down those problematic repaints that dont show any texture
« Reply #3 on: January 27, 2012, 12:48:36 PM »
are you kidding me? Do we both have E:/Flight%20Simulator%209/? :D

Offline Sloeber

  • Senior Captain
  • ******
  • Posts: 840
  • Get you Sh** and get out!
Re: Hunting down those problematic repaints that dont show any texture
« Reply #4 on: January 27, 2012, 01:15:31 PM »
Guess so.. My E: partition is all FS9.. :P
Beam me up Scotty, there's no Intelligent life down here!

Online AirbusManiac

  • Senior Captain
  • ******
  • Posts: 798
Re: Hunting down those problematic repaints that dont show any texture
« Reply #5 on: January 27, 2012, 03:25:11 PM »
Works perfect for me on Win7 x64. When there is a missing texture or so, it stops scanning. Clicking on "Continue" and the search process continues without any crash.

Offline ewerber

  • Turbine Captain
  • *****
  • Posts: 567
    • FSXAIBureau
thanks for all the feedback, a new version 1.1 is uploaded along with the change log at the first post.
Erez Werber,
FSXAIBureau.com

Offline Target

  • Command Captain
  • *******
  • Posts: 1066
  • Checks AIG too often
Hmm, it crashes on my after it reaches approx. 75% of the bar.. I already moved all the UI aircraft outside and just left the AI aircraft in. Win7 64bit just returns "Close Program" option.
One problem signature says something like this: System.IO.DirectoryNotFound
Event name is: CLR20r3
 
Best regards,

Phil
Der Pessimist sieht nur ein Tunnel,
der Optimist sieht ein Tunnel und das Licht am Ende
und der Realist, der sieht den Tunnel, das Licht und den kommenden Zug

Offline Jakob

  • Turbine 2nd Officer
  • ***
  • Posts: 109
    • The Fruit Stand
Same error as Phil has: System.IO.DirectoryNotFound, at ca. 80%. I take it the problem lies with one specific aircraft where something inside is missing?

Code: [Select]
Problem Event Name: CLR20r3
  Problem Signature 01: fstexturecheckerv1.1.exe
  Problem Signature 02: 1.0.0.0
  Problem Signature 03: 4f22d39b
  Problem Signature 04: mscorlib
  Problem Signature 05: 2.0.0.0
  Problem Signature 06: 4e1539fa
  Problem Signature 07: 349e
  Problem Signature 08: 119
  Problem Signature 09: System.IO.DirectoryNotFound
  OS Version: 6.1.7601.2.1.0.256.1
  Locale ID: 1031

Offline Firebird

  • Turbine 2nd Officer
  • ***
  • Posts: 221
  • Quid si coelum ruat
To give you some positive feedback it worked fine on my system, i.e. produced a list.

I am using XP SP3 and FS9. I do have sub folders for textures.

What I did notice was that my AI U2's were complaining that it couldn't find an A-10 texture from another modeller, but I might have a clue why that might be.

If I may make a suggestions that would improve the accuracy of the report, once you have collected the data then scan the \Flight Simulator 9\Texture, or its FSX equivalent, and then either remove any missing textures found or mark them as (GLOBAL).
Steve


Quid Si Coelum Ruat

Offline ewerber

  • Turbine Captain
  • *****
  • Posts: 567
    • FSXAIBureau
Hi Firebird, the latest version (1.1) automatically scans your global texture folder, if the texture is found there it will not be in the missing log.
The one chance the global texture folder wont be found is if you check an FSX aircraft folder which is not placed in the SimObjcets folder.
I have discovered several models who internally have materials and textures that are not belonging to them
I suspect this is because the author of the model added the material (or modified an existing model to become the new model) and never used it etc.
If you know this is a false positive simply add an exclusion rule.
Erez Werber,
FSXAIBureau.com

Offline ewerber

  • Turbine Captain
  • *****
  • Posts: 567
    • FSXAIBureau
Re: FS AI aircraft texture checker (New version 1.2)
« Reply #11 on: February 29, 2012, 04:54:40 PM »
New Version (1.2) which fixed the directory not found exceptions released.
Erez Werber,
FSXAIBureau.com

Offline Firebird

  • Turbine 2nd Officer
  • ***
  • Posts: 221
  • Quid si coelum ruat
Re: FS AI aircraft texture checker (New version 1.2)
« Reply #12 on: February 29, 2012, 05:16:50 PM »
I made sure I was using 1.1 and rechecked. What i found was that indeed some textures were picked up from the FS9\texture folder but strangely not all.
Some examples of this are:-
AIG_FANSHADOW.BMP
DJC_AI_METROIII_PROP.BMP
MAIW_CANOPY_CLEAR.BMP
MAIW_CANOPY_SMOKED.BMP
NBAI_BRAKE_CHUTE.BMP

These are all there and whilst most are 24bit dxt3 one is a 32bit.
So it it seems it either misses the textures or doesn't delete them from the list for some reason.

If you need me to test let me know.
« Last Edit: February 29, 2012, 05:33:03 PM by Firebird »
Steve


Quid Si Coelum Ruat

Offline ewerber

  • Turbine Captain
  • *****
  • Posts: 567
    • FSXAIBureau
Re: FS AI aircraft texture checker (New version 1.21)
« Reply #13 on: February 29, 2012, 05:22:00 PM »
Discovered the source of the problem, its now fixed in V1.21 please try that.
Erez Werber,
FSXAIBureau.com

Offline Firebird

  • Turbine 2nd Officer
  • ***
  • Posts: 221
  • Quid si coelum ruat
Re: FS AI aircraft texture checker (New version 1.21)
« Reply #14 on: February 29, 2012, 05:49:59 PM »
It's a big improvement. The output file is doen from 883kb to 350kb.
Still not perfect though as two textures still not picked up and seem to be used a lot are:-
PROP-HS.BMP
REFL_TEXTURE.BMP

Other than that I have not found any other errors on my system.
Steve


Quid Si Coelum Ruat