Jump to content

Archived

This topic is now archived and is closed to further replies.

vl1

Batch convert files in different folders to remove mips

Recommended Posts

Is there any way to batch convert all aircraft texture files from all aircraft folders from 32bit to dxt3 AND removing mips? i also have lots of mipped dxt3 textures, so i need just to remove mips.i know imagetool batch process, but it requires to put imagetool.exe in the folder and starting it each time in every folder.maybe it is possible with another program so it will enter every folder itself and convert files. if i do it manually it will take a week. thanx

Share this post


Link to post
Share on other sites

You can put a copy of imagetool.exe in your system32 folder, reboot, and you'll be able to run imagetool commands without shuffling imagetool.exe from folder to folder. You can run the following from the Aircraft folder: for /r /d %f in (texture.*) do dir /b /s "%f\*.bmp" >> txtr_list.txt This will make a list of all .bmps that reside in a folder named texture or texture.* which you could conceivably edit/parse into a batch file to convert everything at once. Jim

Share this post


Link to post
Share on other sites

wow, super, i'll try! can you explain all the switches you included and why? thank you!

for /r /d %f in (texture.*) do dir /b /s "%f\*.bmp" >> txtr_list.txt
wow, super, i'll try! can you explain all the switches you included and why? thank you!
moreover, not to spend the time, can you right me an exact string to do the following:1) enter every folder, then enter every subfolder (that would be the aircraft folder and texture subfolder)2) find every bmp file3) remove mipmaps4)save5) go next, etc THANX A LOT AGAIN!

Share this post


Link to post
Share on other sites

What it basically means in english is "for every subdirectory named texture.*, make a directory of the .bmp files contained, and append each entry to a file named txtr_list.txt". Open a command window and type for /? to see an explanation of the switches, and also dir /? for help with the dir command. The for command unfortunately doesn't work with imagetool like it does with dir though we've found out, because it wants to open a copy of Imagetool for every .bmp it finds and within 3 seconds your task bar will fill up with Imagetool buttons and it'll eventually crash something and stop. I really don't think you want to turn something like this loose in your aircraft folder without knowing exactly what it's going to do anyway because you may have VC lightmaps and such that may not work correctly in DXT3. What I'd do is run the command and make the list, then go through it with a fine tooth comb and delete any lines (.bmps) that you're not 100% sure whether you should convert them or not. Then you can use "replace" to turn it into a batch file by replacing every occurance of C:\Microsoft Games\Flight Simulator 9\Aircraft\ with imagetool -dxt3 -brief -nomip -e bmp " for example. Then figure out a way to add a quote on the end of each line and you should have an operative batch file. Advanced text editors like Textpad and Notepad ++ have the ability to record keystroke macros. You could for example record yourself adding the quote to the end of one line and then play back the macro to add the quote to all the remaining lines in the blink of an eye. Jim

Share this post


Link to post
Share on other sites

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    42%
    $10,690.00 of $25,000.00 Donate Now
×
×
  • Create New...