Giter Club home page Giter Club logo

Comments (10)

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

As written by arnaugm (Thank you very much for the work done here)

If for any reason the artist doesn't want two specific traits to appear together, they can be defined as incompatible.

Let's consider an example where we are creating a character with a hat and a background among other layers. And we don't want to generate the character with a white hat if the background is also wait because we don't like how they look together. We can exclude this combination in the configuration.

These incompatibilities can be configured at a layer configuration level with the option incompatibleTraits which is an object where the keys are traits in the format / and the value is an array of all the traits that are incompatible with this one using the same / format.

Example:

const layerConfigurations = [
  {
    growEditionSizeTo: 5,
    layersOrder: [
      { name: "Background" },
      { name: "Eyeball" },
      { name: "Eye color" },
      { name: "Iris" },
      { name: "Shine" },
      { name: "Bottom lid" },
      { name: "Top lid" },
    ],
    incompatibleTraits: {
      "Eye color/Cyan": [
        "Eyeball/Red",
      ],
      "Iris/Large": [
        "Bottom lid/High",
        "Top lid/High",
      ],
    }
  },
];

If the art engine generates a new artwork that contains 2 incompatible traits, this new piece will be discarded and a notification will be displayed in the console with the message:

Combination of traits excluded because of exclusion rules!
The creation of artworks will continue generating new combinations as usual.

This option will reduce the number of possible combinations and could be possible that the collection can not reach the requested number of elements. In this case reduce the number of incompatibilities or provide more traits in the layers that has less options to increase the probability of selecting different traits.

If the option is not defined the restriction is not applied.

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

I have introduced this functionality into my repo and have slightly modified the error that gets returned to the screen to "Combination of traits excluded because of incompatible layers exclusion rule!"

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

Users can now make use of the incompatibleTraits configuration within their layer configuration to excluded or force certain trait combinations.

incompatibleTraits: {
      "Eye color/Cyan": [
        "Eyeball/Red",
      ],
      "Iris/Large": [
        "Bottom lid/High",
        "Top lid/High",
      ],
    }

from create-and-mint-nft-collection.

cesar4design avatar cesar4design commented on August 20, 2024

I'm doing a simple test, I want the spider body and spider head to just go together. But this didn't work. What am I doing wrong?

build
config
layers

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

@cesar4design uou are 50% there. You have set that when Corpo Spider is chosen, then Head Spider should also be chosen. You also need to say that when Head Spider is chosen, only Corpo Spider can be chosen.

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

@cesar4design you do not have any rarities specified, so first add the correct naming convention for your files as per the sample files provided in the code repo.

from create-and-mint-nft-collection.

ae-podgor avatar ae-podgor commented on August 20, 2024

Hi! I am using this configuration to exclude the layer, when specific layer item generates. But it doesn't work as expected.
I expect that if Iris/Large generates, then no item from Bottom lid and Top lid layers will be generated

const layerConfigurations = [ { growEditionSizeTo: 20, maxRepeatedTraits: 10, layersOrder: [ { name: "Background" }, { name: "Eyeball" }, { name: "Eye color" }, { name: "Iris" }, { name: "Shine" }, { name: "Bottom lid"}, { name: "Top lid" }, ], incompatibleTraits: { "Iris/Large": [ "Bottom lid/*", "Top lid/*", ], }, }, ];
7

from create-and-mint-nft-collection.

sruthyroseboban avatar sruthyroseboban commented on August 20, 2024

Screen Shot 2022-09-06 at 2 46 26 PM

i wanted to have dependentTrait function such that petals on ground should match color of flower. dependentTraits: { "ACC/PAT/ACC_PAT_BLACK-METAL":["FLO/FLO_BLACKMETAL",], "ACC/PAT/ACC_PAT_CARBON":["FLO/FLO_CARBON",], "ACC/PAT/ACC_PAT_CD":["FLO/FLO_CD",], "ACC/PAT/ACC_PAT_COLA":["FLO/FLO_COLA",], "ACC/PAT/ACC_PAT_DOLLAR":["FLO/FLO_DOLLAR",], "ACC/PAT/ACC_PAT_fabric":["FLO/FLO_FABRIC",], "ACC/PAT/ACC_PAT_GLASS":["FLO/FLO_GLASS",], "ACC/PAT/ACC_PAT_GOLD":["FLO/FLO_GOLD",], "ACC/PAT/ACC_PAT_JEANS":["FLO/FLO_JEANS",], "ACC/PAT/ACC_PAT_MARBLE":["FLO/FLO_MARBLE",], "ACC/PAT/ACC_PAT_METALIC":["FLO/FLO_METALIC",], "ACC/PAT/ACC_PAT_OVO":["FLO/FLO_OVO",], "ACC/PAT/ACC_PAT_PAINTEDMETAL":["FLO/FLO_PAINTEDMETAL",], "ACC/PAT/ACC_PAT_SELVER":["FLO/FLO_SELVER",], "ACC/PAT/ACC_PAT_VELVET_BLACK":["FLO/FLO_VELVET_BLACK",], "ACC/PAT/ACC_PAT_VELVET_BLOOD":["FLO/FLO_VELVET_BLOOD",], "ACC/PAT/ACC_PAT_VELVET_BROWN":["FLO/FLO_VELVET_BROWN",], "ACC/PAT/ACC_PAT_VELVET_CYAN":["FLO/FLO_VELVET_CYAN",], "ACC/PAT/ACC_PAT_VELVET_GREEN":["FLO/FLO_VELVET_GREEN",], "ACC/PAT/ACC_PAT_VELVET_LAVANDER1":["FLO/FLO_VELVET_LAVANDER1",], "ACC/PAT/ACC_PAT_VELVET_LAVANDER2":["FLO/FLO_VELVET_LAVANDER2",], "ACC/PAT/ACC_PAT_VELVET_ORANGE":["FLO/FLO_VELVET_ORANGE",], "ACC/PAT/ACC_PAT_VELVET_PASTELRED":["FLO/FLO_VELVET_PASTELRED",], "ACC/PAT/ACC_PAT_VELVET_PASTELRED":["FLO/FLO_VELVET_PINK",], "ACC/PAT/ACC_PAT_VELVET_RED":["FLO/FLO_VELVET_RED",], "ACC/PAT/ACC_PAT_VELVET_SKY":["FLO/FLO_VELVET_SKY",], "ACC/PAT/ACC_PAT_VELVET_TIFFANYBLUE":["FLO/FLO_VELVET_TIFFANYBLUE",], "ACC/PAT/ACC_PAT_VELVET_VIOLET":["FLO/FLO_VELVET_VIOLET",], "ACC/PAT/ACC_PAT_VELVET_VIOLET1":["FLO/FLO_VELVET_VIOLET1",], "ACC/PAT/ACC_PAT_VELVET_WHITE-":["FLO/FLO_VELVET_WHITE",], "ACC/PAT/ACC_PAT_VELVET_YELLOW":["FLO/FLO_VELVET_YELLOW",], } what am i doing wrong

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

Hi! I am using this configuration to exclude the layer, when specific layer item generates. But it doesn't work as expected. I expect that if Iris/Large generates, then no item from Bottom lid and Top lid layers will be generated

const layerConfigurations = [ { growEditionSizeTo: 20, maxRepeatedTraits: 10, layersOrder: [ { name: "Background" }, { name: "Eyeball" }, { name: "Eye color" }, { name: "Iris" }, { name: "Shine" }, { name: "Bottom lid"}, { name: "Top lid" }, ], incompatibleTraits: { "Iris/Large": [ "Bottom lid/*", "Top lid/*", ], }, }, ]; 7

Apologies, the * setting does not actually work. A few other users tested as well. I will be removing it from the comments.

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024
Screen Shot 2022-09-06 at 2 46 26 PM

i wanted to have dependentTrait function such that petals on ground should match color of flower. dependentTraits: { "ACC/PAT/ACC_PAT_BLACK-METAL":["FLO/FLO_BLACKMETAL",], "ACC/PAT/ACC_PAT_CARBON":["FLO/FLO_CARBON",], "ACC/PAT/ACC_PAT_CD":["FLO/FLO_CD",], "ACC/PAT/ACC_PAT_COLA":["FLO/FLO_COLA",], "ACC/PAT/ACC_PAT_DOLLAR":["FLO/FLO_DOLLAR",], "ACC/PAT/ACC_PAT_fabric":["FLO/FLO_FABRIC",], "ACC/PAT/ACC_PAT_GLASS":["FLO/FLO_GLASS",], "ACC/PAT/ACC_PAT_GOLD":["FLO/FLO_GOLD",], "ACC/PAT/ACC_PAT_JEANS":["FLO/FLO_JEANS",], "ACC/PAT/ACC_PAT_MARBLE":["FLO/FLO_MARBLE",], "ACC/PAT/ACC_PAT_METALIC":["FLO/FLO_METALIC",], "ACC/PAT/ACC_PAT_OVO":["FLO/FLO_OVO",], "ACC/PAT/ACC_PAT_PAINTEDMETAL":["FLO/FLO_PAINTEDMETAL",], "ACC/PAT/ACC_PAT_SELVER":["FLO/FLO_SELVER",], "ACC/PAT/ACC_PAT_VELVET_BLACK":["FLO/FLO_VELVET_BLACK",], "ACC/PAT/ACC_PAT_VELVET_BLOOD":["FLO/FLO_VELVET_BLOOD",], "ACC/PAT/ACC_PAT_VELVET_BROWN":["FLO/FLO_VELVET_BROWN",], "ACC/PAT/ACC_PAT_VELVET_CYAN":["FLO/FLO_VELVET_CYAN",], "ACC/PAT/ACC_PAT_VELVET_GREEN":["FLO/FLO_VELVET_GREEN",], "ACC/PAT/ACC_PAT_VELVET_LAVANDER1":["FLO/FLO_VELVET_LAVANDER1",], "ACC/PAT/ACC_PAT_VELVET_LAVANDER2":["FLO/FLO_VELVET_LAVANDER2",], "ACC/PAT/ACC_PAT_VELVET_ORANGE":["FLO/FLO_VELVET_ORANGE",], "ACC/PAT/ACC_PAT_VELVET_PASTELRED":["FLO/FLO_VELVET_PASTELRED",], "ACC/PAT/ACC_PAT_VELVET_PASTELRED":["FLO/FLO_VELVET_PINK",], "ACC/PAT/ACC_PAT_VELVET_RED":["FLO/FLO_VELVET_RED",], "ACC/PAT/ACC_PAT_VELVET_SKY":["FLO/FLO_VELVET_SKY",], "ACC/PAT/ACC_PAT_VELVET_TIFFANYBLUE":["FLO/FLO_VELVET_TIFFANYBLUE",], "ACC/PAT/ACC_PAT_VELVET_VIOLET":["FLO/FLO_VELVET_VIOLET",], "ACC/PAT/ACC_PAT_VELVET_VIOLET1":["FLO/FLO_VELVET_VIOLET1",], "ACC/PAT/ACC_PAT_VELVET_WHITE-":["FLO/FLO_VELVET_WHITE",], "ACC/PAT/ACC_PAT_VELVET_YELLOW":["FLO/FLO_VELVET_YELLOW",], } what am i doing wrong

The code base unfortunately does not allow for sub folders within layers, this is why its not working.

from create-and-mint-nft-collection.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.