mirror of
https://github.com/drewcassidy/quicktex.git
synced 2024-09-13 06:37:34 +00:00
Skip any dds files when encoding
This commit is contained in:
parent
8509384bff
commit
cbec93ed55
@ -40,7 +40,7 @@ def path_pairs(inputs, output, suffix, extension):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if len(inputs) < 1:
|
if len(inputs) < 1:
|
||||||
raise click.BadArgumentUsage('No input files were provided.')
|
raise click.BadArgumentUsage('No valid input files were provided.')
|
||||||
|
|
||||||
inpaths = [pathlib.Path(i) for i in inputs]
|
inpaths = [pathlib.Path(i) for i in inputs]
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ def encode():
|
|||||||
)
|
)
|
||||||
@click.argument('filenames', nargs=-1, type=click.Path(exists=True, readable=True, dir_okay=False))
|
@click.argument('filenames', nargs=-1, type=click.Path(exists=True, readable=True, dir_okay=False))
|
||||||
def encode_format(encoder, four_cc, flip, remove, suffix, output, filenames, swizzle=False):
|
def encode_format(encoder, four_cc, flip, remove, suffix, output, filenames, swizzle=False):
|
||||||
|
filenames = [f for f in filenames if not f.endswith('.dds')]
|
||||||
path_pairs = common.path_pairs(filenames, output, suffix, '.dds')
|
path_pairs = common.path_pairs(filenames, output, suffix, '.dds')
|
||||||
|
|
||||||
with click.progressbar(
|
with click.progressbar(
|
||||||
@ -112,8 +113,11 @@ def encode_auto(level, black, threecolor, flip, remove, suffix, output, filename
|
|||||||
|
|
||||||
bc1_encoder = quicktex.s3tc.bc1.BC1Encoder(level, mode)
|
bc1_encoder = quicktex.s3tc.bc1.BC1Encoder(level, mode)
|
||||||
bc3_encoder = quicktex.s3tc.bc3.BC3Encoder(level)
|
bc3_encoder = quicktex.s3tc.bc3.BC3Encoder(level)
|
||||||
|
filenames = [f for f in filenames if not f.endswith('.dds')]
|
||||||
path_pairs = common.path_pairs(filenames, output, suffix, '.dds')
|
path_pairs = common.path_pairs(filenames, output, suffix, '.dds')
|
||||||
|
|
||||||
|
assert len(filenames) > 0
|
||||||
|
|
||||||
with click.progressbar(
|
with click.progressbar(
|
||||||
path_pairs, show_eta=False, show_pos=True, item_show_func=lambda x: str(x[0]) if x else ''
|
path_pairs, show_eta=False, show_pos=True, item_show_func=lambda x: str(x[0]) if x else ''
|
||||||
) as bar:
|
) as bar:
|
||||||
|
Loading…
Reference in New Issue
Block a user