Aller au contenu

Photo

Batch conversion of texture files?


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
rjshae

rjshae
  • Members
  • 4 491 messages

Has anybody used the batch processing feature of Gimp to convert large numbers of DDS/TGA texture files to DDS with mipmaps? I though I'd ask first to see if there is a handy Gimp script already available, before spending a bunch of time on it. Thanks.


  • PJ156 aime ceci

#2
Mythyzyn

Mythyzyn
  • Members
  • 17 messages

Do you have access to the .exe which will convert as command line ?

 

To know, you can try thing like this :

 

path/my.exe /? in a command line prompt, it will show the options available

 

If yes, I did some batch scripts for kivinien exe tools, whiling to convert all files in a directory with options presets



#3
rjshae

rjshae
  • Members
  • 4 491 messages

Yes, I do have access to the Command Tool in Windows; it is what I was planning to use for running the script in batch mode. There are some  Script-Fu tutorials online, and I believe there is a globbing function available. I was just hoping somebody might have already done something like this with Gimp. Thanks.



#4
Mythyzyn

Mythyzyn
  • Members
  • 17 messages

I didnt do it for Gimp but I think that you can adapt my batch enough easil for it

 

This is for convert all TRX in JPG

@echo off
echo ### 
echo ### ---
echo ### TRX_to_JPG
echo ### ---
echo ### EXE by Kivinien
echo ### http://www.kivinen.iki.fi/nwn/
echo ### ---
echo ### BATCH by Mythyzyn
echo ### http://www.lyncya.fr
echo ### ---
echo ### 
pause 
echo ### ---
dir %cd%\dir /w /b %cd% > temp_list.txt

for /f "delims=" %%i in ('type "temp_list.txt" ^|findstr /i /r ".trx"') do echo %%i >> trx_list.txt

for /f %%a in (%cd%\trx_list.txt) do ( 
echo ### 
echo ### Traitement du fichier : %%a
echo ### 
trngraph  -g default -a default -s 10 -o %%a.jpg %%a
echo ### 
echo ### %%a converti.
echo ### 
echo ### ---
)
del temp_list.txt
del trx_list.txt
echo ###
echo ###
echo ### Fini.
echo ###
echo ###
pause

  • rjshae aime ceci