Batch DDS to TGA converter

Post any tutorial and tools you might find it useful for other creators.
Post Reply
User avatar
davidzoli
Posts: 2245
Joined: 22 Jun 2014 10:08
Location: Budapest, Hungary

Batch DDS to TGA converter

#1 Post by davidzoli » 19 Sep 2015 21:11

Blender Tools needs TGA files for textures. To get them, you can convert the DDS files from the base folder.
Converting can made some photo manipulation software or online tools or an NVIDIA converter.
So, I get that NVIDIA tool and make batch files to make the conversion process easy.
You can find it here: https://github.com/davidzoli/batch_dds2tga or download a zip from here: http://link.davidzoltan.hu/dds2tga1

Your job is only drop a file or folder onto the bat file and after some question, all the conversion will be made for you.
The file converter process one or more dropped files. There is a folder converter too which make a copy of the given folder (structure) and DDS files. After the copy it will convert the DDS file(s) and leave only the TGA (or the copied DDS too).

So you can convert whole folders to get TGA files before start a Blender Tools project.
:!: Be careful with recursion! :D
:!: I've converted the whole base! It took 40 minutes (of ~6400 files) and 4.6GB disk space (~8GB during conversion)

Code: Select all

convert_file.bat - Bat for convert file(s). 
Drop a file or set of files onto the bat. Converter will be called and make a TGA file beside of the original DDS.

convert_folder.bat - File process a dropped folder.
User can deside to do the process recursively or not. Not recursive run will convert the files only in the dropped folder.
Recursive run will create the whole directory structure.
Folder convert always create a folder (*_converted) beside of the original folder and copy the dds files in the original folders structure.
User can decide whether keep the copied DDS files or not.
Feel free to make it better!
Or make a better solution for this kind of "problem". My desktop programming skills and freetime for this ends here.
There must be some serious programmer here :) Maybe Cadde? :P

Posted on my ets2 blog too: http://ets2.davidzoltan.hu/batch-files- ... ds-to-tga/
Last edited by ohaha on 20 Sep 2015 09:29, edited 1 time in total.
Reason: Moved from General Discussions
User avatar
50keda
SCS Software
Posts: 1699
Joined: 07 Dec 2012 11:59

Re: Batch DDS to TGA converter

#2 Post by 50keda » 20 Sep 2015 09:19

Nice one!

PS: Moderators please move this topic to User Tutorials as I think it's more suitable for that forum.
User avatar
Smarty
Beta tester
Posts: 1983
Joined: 30 Jun 2015 01:56
Location: Ontario, Canada
Contact:

Re: Batch DDS to TGA converter

#3 Post by Smarty » 07 Mar 2017 21:26

Just a quick tip: Normal maps (at least the usual 3Dc type) converted by this method need to have the R and G channels swapped to work correctly.

Otherwise, it does a much better job than the NVIDIA Photoshop Plugin, which doesn't properly correct the scale and bias from the 3Dc format, hence why properly formatted dds normal maps look so bright when imported into PS. :lol:
User avatar
DaStig
Posts: 3426
Joined: 26 Jan 2015 17:35
Location: Stigmania
Contact:

Re: Batch DDS to TGA converter

#4 Post by DaStig » 07 Mar 2017 21:39

Does this mean that all skins need to be rebuild, since they use .dds texture files ? Or is the game still capable of handling regular .dds textures?

DaStig
Member of GTM Team | ETS2 Screenshots | ATS Screenshots | Flickr | Facebook
AMD Ryzen 7 2700 | MSI B450M Mortar | GTX 1070Ti 8GB | Corsair Vengeance 16GB RAM | 3x SSD Samsung 850 Pro 250GB | Dell UtraSharp 27" U2719D

[ external image ]
User avatar
SiSL
SCS Software
Posts: 8663
Joined: 27 Oct 2013 06:23
Contact:

Re: Batch DDS to TGA converter

#5 Post by SiSL » 07 Mar 2017 21:43

BT is capable of handling DDS files, however, recommendation is TGA because TGA is not compressed and does not get distorted.
User avatar
DaStig
Posts: 3426
Joined: 26 Jan 2015 17:35
Location: Stigmania
Contact:

Re: Batch DDS to TGA converter

#6 Post by DaStig » 07 Mar 2017 21:46

I always used uncompressed dds-textures, without that dxt5 compression ... which don't get distorted either ...
Member of GTM Team | ETS2 Screenshots | ATS Screenshots | Flickr | Facebook
AMD Ryzen 7 2700 | MSI B450M Mortar | GTX 1070Ti 8GB | Corsair Vengeance 16GB RAM | 3x SSD Samsung 850 Pro 250GB | Dell UtraSharp 27" U2719D

[ external image ]
User avatar
SiSL
SCS Software
Posts: 8663
Joined: 27 Oct 2013 06:23
Contact:

Re: Batch DDS to TGA converter

#7 Post by SiSL » 07 Mar 2017 21:48

Well, your choice... In the end, you obviously know DXT versions, which makes you think you know how to save them as TGA as well :)

Convertion Tools makes amazing job on converting, I do my trailer skins, which has no models in it with convertion tools.
User avatar
Smarty
Beta tester
Posts: 1983
Joined: 30 Jun 2015 01:56
Location: Ontario, Canada
Contact:

Re: Batch DDS to TGA converter

#8 Post by Smarty » 07 Mar 2017 22:33

DaStig: I think you misunderstood the context/relevance of this thread/tool. The game still uses dds formats. Using targa in-game would be a huge resource waste.

This is about converting those to targa format for use in SCS Blender Tools. For most resources (DXT1, DXT5, R8G8B8[A8], A8L8, A8) that's somewhat unnecessary (but still a 'best practice') because BT can display them correctly. 3Dc normal maps (correct format for tsnmap) are a different story because they are so different from the source format. Like so many things, it depends on your use case. ;)
Volvo F12
Posts: 107
Joined: 02 Nov 2013 19:58

Re: Batch DDS to TGA converter

#9 Post by Volvo F12 » 06 May 2017 10:23

Hello davidzoli

Thank you for you batch file converter but i have a question
Does this batch file converts..hm..most likely corrects the file extension
refering to the dds file..inside the tobj's.
You see i converted my dds's from my base file to tga with another software
but all the tobj's are reffering to dds file not tga and i have to correct them
manyally..so..does your batch file also corrects this problem?

Thank you in advance
User avatar
ryzenmaster75
Posts: 145
Joined: 10 Jun 2019 16:08
Location: Jakarta, Indonesia
Contact:

Re: Batch DDS to TGA converter

#10 Post by ryzenmaster75 » 07 Feb 2023 16:11

sorry to bump an old thread,

i have a question, does this method still working properly right now ?, i tried using it but on the result folder its empty. or maybe i do it the wrong way :?
Post Reply

Return to “User Tutorials & Tools”

Who is online

Users browsing this forum: No registered users and 6 guests