Skip to content

Commit

Permalink
Fix incorrect argparse types for --output and --material.
Browse files Browse the repository at this point in the history
Using `nargs=1` was wrong because that turns the argument into a list type,
so the below `output_name = args.output` would have `output_name` be a list,
not a file path string as intended.

Fixes crash:

      File "objuvpacker.py", line 110, in main
        outname = output_name+"_full.png"
    TypeError: can only concatenate list (not "str") to list
  • Loading branch information
nh2 committed Aug 6, 2020
1 parent 2f5a405 commit 611582f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions objuvpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def guess_realpath(path):
def main():
parser = argparse.ArgumentParser(description="Naively pokes obj+mtls")
parser.add_argument("obj", help="path to the .obj file")
parser.add_argument("-m", "--material", nargs=1, help="path to the .mtl file")
parser.add_argument("-o","--output", nargs=1, help="output name, used for image and folder")
parser.add_argument("-m", "--material", help="path to the .mtl file")
parser.add_argument("-o","--output", help="output name, used for image and folder")
parser.add_argument("-a","--add", nargs="+", help="any additional images to pack")

parser.add_argument('--no-crop', dest='crop', action='store_false', help="do not attempt to crop textures to just what is used")
Expand Down

0 comments on commit 611582f

Please sign in to comment.