Converts any number of files to `.dds` format, automatically choosing dxt1 or dxt5 depending on if the source image has anything in its alpha channel. Designed to be used with a glob, e.g: `ddscompress.py *.png`
@ -21,6 +21,9 @@ Converts any number of files to `.dds` format, automatically choosing dxt1 or dx
##### optional arguments:
* `-h, --help `: show this help message and exit
* `--format {auto,DXT1,DXT5}`: output texture format (default: auto)
* `--nomips, -m`: Do not generate mipmaps
* `--noflip, -f`: Do not flip the image
* `--keep, -k`: Do not delete originals
* `--convertcmd CMD`: name of imagemagick's convert tool (default: `convert`)
* `--compresscmd CMD`: name of the nvidia dds compress tool (default: `nvcompress`)
@ -37,7 +40,7 @@ Converts any number of files to `.tga` from `.dds`. Designed to be used with a g
* `--decompresscmd CMD`: name of the nvidia dds decompress tool (default: `nvdecompress`)
Checks any number of dds files for common issues, including formats not supported by KSP, and DXT5 textures that don't use the alpha channel. Designed to be used with a glob, e.g: `ddsck.py *.dds`
@ -46,5 +49,7 @@ Checks any number of dds files for common issues, including formats not supporte
##### optional arguments:
* `-h, --help`: show this help message and exit
* `--transparency, -t`: Generate a list of files that fail the transparency check
* `--format, -f`: Generate a list of files that fail the format check
* `--convertcmd CMD`: name of imagemagick's convert tool (default: `convert`)
* `--infocmd CMD`: name of the nvidia dds info tool (default: `nvddsinfo`)
parser=argparse.ArgumentParser(description="Checks any number of dds files for common issues, including formats not supported by KSP, and DXT5 textures that don't use the alpha channel.")
modes.add_argument('--transparency','-t',dest='mode',action='store_const',const="transparency",default="none",help="Generate a list of files that fail the transparency check")
modes.add_argument('--format','-f',dest='mode',action='store_const',const="format",default="none",help="Generate a list of files that fail the format check")
parser.add_argument('--convertcmd',type=str,metavar='CMD',default="convert",help="name of imagemagick's convert tool (default: %(default)s)")
parser.add_argument('--infocmd',type=str,metavar='CMD',default="nvddsinfo",help="name of the nvidia dds info tool (default: %(default)s)")
@ -27,6 +32,12 @@ for argv in args.files:
pass
elifformat=="DXT5":
ifalpha>254:
ifargs.mode=='none':
print(f'[{argv}]: Image is DXT5 but has no alpha channel')
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.")