Jon-Becker / nft-generator-py

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

incompatibilities not working for me #19

Closed Stadtrausch closed 2 years ago

Stadtrausch commented 2 years ago

dear friend,

could not figure out why the incompatibilities is not working for me. is this feature still in development or should it work as described ? help would be much appreciated

thank you


    {
      "name": "BOTS",
      "values": ["Bombed", "Doodle", "Gold", "Green", "Grey", "Ironman", "Rot", "Wood", "Yellow", "Zombie"],
      "trait_path": "./trait-layers/2_BOTS",
      "filename": ["Bombed", "Doodle", "Gold", "Green", "Grey", "Ironman", "Rot", "Wood", "Yellow", "Zombie"],
      "weights": [8, 12, 2, 15, 15, 6, 15, 7, 15, 5]
    },
    {
      "name": "EYES",
      "values": ["Bullaugen", "Eyes_human", "Hawt_Augen", "Schlitzauge", "Tearsdrops"],
      "trait_path": "./trait-layers/4_EYES",
      "filename": ["Bullaugen", "Eyes_human", "Hawt_Augen", "Schlitzauge", "Tearsdrops"],
      "weights": [20, 20, 20, 20, 20]
    },

    ...

     "incompatibilities": [
    {"layer": "BOTS", "value": "Ironman", "incompatible_with": ["Bullaugen"]},
    {"layer": "BOTS", "value": "Ironman", "incompatible_with": ["Eyes_human"]},
    {"layer": "BOTS", "value": "Ironman", "incompatible_with": ["Hawt_Augen"]},
    {"layer": "BOTS", "value": "Ironman", "incompatible_with": ["Schlitzauge"]},
    {"layer": "BOTS", "value": "Ironman", "incompatible_with": ["Tearsdrops"]}

  ],
Jon-Becker commented 2 years ago

incompatible_with is an array. put all incompatible traits in it.

Ex: ["eyes_human", "teardrops"]

Stadtrausch commented 2 years ago

thanks! changed it up but somehow it has no effect

{"layer": "BOTS", "value": "Ironman", "incompatible_with": ["bullaugen", "eyes_human", "hawt_Augen", "schlitzauge", "tearsdrops"]}
Jon-Becker commented 2 years ago

Add a blank layer to EYES. It needs to find an image for that layer even if you don't want one there. Make a blank PNG and name it "none" or something, then add it like the other possible images in EYES.

Stadtrausch commented 2 years ago

thanks for the tip, but then i get a few combinations where the EYES are missing where they should not. sorry for bothering you :)

fromMaianor commented 2 years ago

Sorry to interfere, even when you set the blank png weight to 0?

Jon-Becker commented 2 years ago

thanks for the tip, but then i get a few combinations where the EYES are missing where they should not. sorry for bothering you :)

I will look for a solution for now. You can add an imcompatibility with EYES none with everything but ironman. It'll only pick a none layer if ironman is selected then, and never pick a none layer otherwise.

Jon-Becker commented 2 years ago

Sorry to interfere, even when you set the blank png weight to 0?

It would never be selected then and you would get infinite recursion.

Stadtrausch commented 2 years ago

i added "none" to the eyes and tried it like this but still not working. i could upload the project? :)

"incompatibilities": [ {"layer": "BOTS", "value": "ironman", "incompatible_with": ["bullaugen", "eyes_human", "hawt_augen", "schlitzauge", "tearsdrops"]}, {"layer": "EYES", "value": "bullaugen", "incompatible_with": ["ironman"]}, {"layer": "EYES", "value": "eyes_human", "incompatible_with": ["ironman"]}, {"layer": "EYES", "value": "hawt_augen", "incompatible_with": ["ironman"]}, {"layer": "EYES", "value": "schlitzauge", "incompatible_with": ["ironman"]}, {"layer": "EYES", "value": "tearsdrops", "incompatible_with": ["ironman"]} ]

Jon-Becker commented 2 years ago

i added "none" to the eyes and tried it like this but still not working. i could upload the project? :)

"incompatibilities": [

{"layer": "BOTS", "value": "ironman", "incompatible_with": ["bullaugen", "eyes_human", "hawt_augen", "schlitzauge", "tearsdrops"]},

{"layer": "EYES", "value": "bullaugen", "incompatible_with": ["ironman"]},

{"layer": "EYES", "value": "eyes_human", "incompatible_with": ["ironman"]},

{"layer": "EYES", "value": "hawt_augen", "incompatible_with": ["ironman"]},

{"layer": "EYES", "value": "schlitzauge", "incompatible_with": ["ironman"]},

{"layer": "EYES", "value": "tearsdrops", "incompatible_with": ["ironman"]}

]

Yes please upload your project or email me at jonathan@jbecker.dev.

Stadtrausch commented 2 years ago

thank you so much! email is sent

Jon-Becker commented 2 years ago

Fixed your code.

"incompatibilities": [
    {"layer": "BOTS", "value": "Ironman", "incompatible_with": ["Bullaugen", "Eyes_human", "Hawt_Augen", "Schlitzauge", "Tearsdrops"]},
    {"layer": "EYES", "value": "None", "incompatible_with": ["Bombed","Doodle","Gold","Green","Grey","Rot","Wood","Yellow","Zombie"]}
  ],

Please make sure you are matching case. You were doing "ironman" when the layer value was "Ironman", etc. I fixed them for you, and added the None layer for EYES. Enjoy!

Dope project by the way.

fromMaianor commented 2 years ago

top man