@ -10,6 +10,7 @@ import dds
parser = argparse . ArgumentParser ( description = " Converts any number of textures to dds format. automatically chooses dxt1 or dxt5 depending on if the source image has anything in its alpha channel. " )
parser . add_argument ( ' files ' , type = str , nargs = ' * ' , help = " input texture files " )
parser . add_argument ( ' --format ' , type = str , choices = [ ' auto ' , ' DXT1 ' , ' DXT5 ' ] , default = " auto " , help = " output texture format (default: %(default)s ) " )
parser . add_argument ( ' --nomips ' , ' -n ' , dest = ' mips ' , action = ' store_false ' , help = " Do not generate mipmaps " )
parser . add_argument ( ' --convertcmd ' , type = str , metavar = ' CMD ' , default = " convert " , help = " name of imagemagick ' s convert tool (default: %(default)s ) " )
parser . add_argument ( ' --compresscmd ' , type = str , metavar = ' CMD ' , default = " nvcompress " , help = " name of the nvidia dds compress tool (default: %(default)s ) " )
@ -32,5 +33,6 @@ with tempfile.TemporaryDirectory() as tempDir:
else :
format = " -bc1 "
dds . nvcompress ( format , tmpOutput , output )
dds . nvcompress ( format , tmpOutput , output , args . mips )
if os . path . basename ( file ) != os . path . basename ( output ) :
os . remove ( file )