Jon-Becker / nft-generator-py

This tool allows users to generate sets of unique images and metadata using weighted layer collections.
MIT License
306 stars 127 forks source link

Getting List index out of range error. #6

Closed stocktonellis closed 2 years ago

stocktonellis commented 2 years ago

When I try to run the program with my attributes, I keep getting this error: Not sure why? I did add more traits and values than the original. Any ideas?

% python3 index.py

Traceback (most recent call last): File "/Users/NAME/Desktop/nft-generator/index.py", line 83, in generate_unique_images(8888, { File "/Users/NAME/Desktop/nft-generator/index.py", line 28, in generate_unique_images trait_files[trait["name"]][key] = trait["filename"][x]; IndexError: list index out of range

Jon-Becker commented 2 years ago

Please upload your configuration

Jon-Becker commented 2 years ago

Looks like the PDF cuts it off.

Please zip your project and email it to me, so I can debug it. Thanks!

stocktonellis commented 2 years ago

Will do later tonight.

Jon-Becker commented 2 years ago

Sounds good, thank you!

Jon-Becker commented 2 years ago
{
      "name": "Mouth",
      "values": ["Closed", "Frown", "Golden-Teeth", "Grumpy", "Smile", "Snorkle", "Tounge-Out", "Mouth-none"],
      "trait_path": "./trait-layers/Mouth",
      "filename": ["blue", "orange", "purple", "red", "yellow"],
      "weights": [10,15,4,3.9,20,.1,14,33]
    },

Lines 120-126. Looks like the Values don't match the filenames, which would cause the error you showed.

stocktonellis commented 2 years ago

Oh my goodness. I'm an idiot. Thanks so much!