You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
763 B
Python

#!/usr/bin/env python3
import sys
import os
import os.path
import argparse
import dds
parser = argparse.ArgumentParser(description="Converts any number of files from dds to tga.")
parser.add_argument('files', type=str, nargs='*', help = "input dds files")
parser.add_argument('--decompresscmd', type=str, metavar='CMD', default=dds.decompresscmd, help="name of the nvidia dds decompress tool (default: %(default)s)")
args = parser.parse_args()
dds.decompresscmd = args.decompresscmd
for argv in args.files:
print(f'[{argv}]: converting from dds to tga')
file = os.path.abspath(argv)
output = os.path.splitext(file)[0] + f".tga"
dds.nvdecompress(file, output)
if os.path.basename(file) != os.path.basename(output):
os.remove(file)