Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an ["occurenceLimiter"] object to layersSetup #918

Open
marcneagu opened this issue Mar 9, 2022 · 6 comments
Open

Adding an ["occurenceLimiter"] object to layersSetup #918

marcneagu opened this issue Mar 9, 2022 · 6 comments

Comments

@marcneagu
Copy link

Hey, guys! Is there possible to add a new object in the const layersSetup? I need to add something that limits to 1 (or 2,3, etc.) the occurrences of items in a SPECIFIC folder. For example, if I have a folder with 1000 images and I want all of them to appear in my final NFT.
Example:

main.js
const layersSetup = (layersOrder) => {
const layers = layersOrder.map((layerObj, index) => ({
id: index,
elements: getElements(${layersDir}/${layerObj.name}/),
occurrenceLimiter:
layerObj.options?.["occurrenceLimiter"] != undefined
? layerObj.options?.["occurrenceLimiter"]
: true,

config.js
growEditionSizeTo: 150,
layersOrder: [
{ name: "Background" },
{ name: "Head" },
{ name: "Eyes", options: {occurrenceLimiter: "1",}, },
{ name: "Mouth" },
{ name: "Eyeswear" },
{ name: "Headwear", options: { blend: MODE.overlay, opacity: 0.7 }, },
{ name: "AlienHeadwear" },
],
},
];

@bolshoytoster
Copy link

@marcneagu I think either thePeanutGalleryandCo's repo or nftchef's repo have this.

@marcneagu
Copy link
Author

They have something else...not a function that limits the occurrences of files in a folder

@bolshoytoster
Copy link

@marcneagu on thePeanutGalleryandCo’s repo, there is a maxRepeatedTrait attribute, you should set this to 1.

@marcneagu
Copy link
Author

Thank you @bolshoytoster !
Yes, this works at a global level, the traits in all layers will not repeat after "3". This is not the result I am expecting.
growEditionSizeTo: 20,
maxRepeatedTraits: 3,
layersOrder: [
{ name: "Background" },
. . . . . . .

And if i set it under a certain layer, it works just fine, but I have to specify each layer in the "Main body" folder. When you have a few thousands of them, it's a lot of work.

  { name: "Hats" },
],
layerItemsMaxRepeatedTraits: [
  { name: "Main body/fel01", layerItemMaxRepeatedTrait: 1 },
  { name: "Main body/fel02", layerItemMaxRepeatedTrait: 1 },
  . . . . .

It would be nice if it would work with the hole folder, like this:

layerItemsMaxRepeatedTraits: [
  { name: "Main body", layerItemMaxRepeatedTrait: 1 },

],

Any thoughts @thepeanutgalleryandco ?

@bolshoytoster
Copy link

@marcneagu

It would be nice if it would work with the hole folder, like this:

layerItemsMaxRepeatedTraits: [
  { name: "Main body", layerItemMaxRepeatedTrait: 1 },
],

did you try generating with that config?

@marcneagu
Copy link
Author

Yes I did. And it returns duplicates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants