-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Is it possible to merge collection #1189
Comments
@bolshoytoster Please check this. |
@santosh-kumar-kaushal you could copy the images and individual metadata files from 2 & 3 into the first collection, delete the Is there any reason you can't just generate it as one collection? |
@bolshoytoster I want to use different layers for a single base. base is different in size. please suggest the best way to do it. I want to shuffle them once the collection is created. 1000 with one base, 1001-2000 with another base and so on. now once I make a shuffle couple of them comes from 1001-2000 collection to 0-1000. |
@bolshoytoster Please help |
@santosh-kumar-kaushal if you're fine with regenerating, you could use my fork which lets you set Once you have the single collection you could shuffle it with some really hacky untested code that probably doesn't work: const basePath = process.cwd();
const fs = require("fs");
let array = fs.readFileSync(`${basePath}/build/json/_metadata.json`);
array = JSON.parse(array);
let randomIndex;
array.forEach((currentElement, currentIndex) => {
do {
randomIndex = Math.floor(Math.random() * array.length) + 1;
} while (currentElement.edition == randomIndex)
fs.renameSync(
`${basePath}/build/images/${randomIndex}.png`,
`${basePath}/build/images/${randomIndex}.png.lol`
)
fs.renameSync(
`${basePath}/build/images/${currentElement.edition}.png`,
`${basePath}/build/images/${randomIndex}.png`
)
fs.renameSync(
`${basePath}/build/images/${randomIndex}.png.lol`,
`${basePath}/build/images/${currentElement.edition}.png`
)
temp = array[array.findIndex(k => k.edition == randomIndex)];
array[array.findIndex(k => k.edition == randomIndex)] = array[array.findIndex(k => k.edition == currentElement.edition)];
array[array.findIndex(k => k.edition == currentElement.edition)] = temp;
});
fs.writeFileSync(
`${basePath}/build/json/_metadata.json`,
JSON.stringify(array, null, 2)
); Then run |
@bolshoytoster so you mean the single collection will be shuffled including images and JSON files Let's say 2.png is now 120.png with its JSON |
@santosh-kumar-kaushal it should be (if the code works). |
@bolshoytoster Let me try and will come back soon, Thanks a lot for helping me out :) I have another short question is there a possibility if we can combine layers GIF + PNG = GIF |
@santosh-kumar-kaushal does this help? |
No actually, I have GIFs and PNGs, this repo creates gifs out of PNGs |
@santosh-kumar-kaushal well you'll have to split the gifs into individual frames then. |
I'm trying to merge the collection, will try this once this is successful, will keep you posted. |
@bolshoytoster This is shuffling the images in the image folder but not shuffling the JSON files in the JSON folder. Please help. |
@santosh-kumar-kaushal did you run |
Yes, I did but Json files are not shuffling, it stays as it is. |
@santosh-kumar-kaushal what about this: const basePath = process.cwd();
const fs = require("fs");
let array = fs.readFileSync(`${basePath}/build/json/_metadata.json`);
array = JSON.parse(array);
let randomIndex;
array.forEach((currentElement, currentIndex) => {
do {
randomIndex = Math.floor(Math.random() * array.length) + 1;
} while (currentElement.edition == randomIndex)
fs.renameSync(
`${basePath}/build/images/${randomIndex}.png`,
`${basePath}/build/images/${randomIndex}.png.lol`
)
fs.renameSync(
`${basePath}/build/images/${currentElement.edition}.png`,
`${basePath}/build/images/${randomIndex}.png`
)
fs.renameSync(
`${basePath}/build/images/${randomIndex}.png.lol`,
`${basePath}/build/images/${currentElement.edition}.png`
)
temp = array[array.findIndex(k => k.edition == randomIndex)].edition;
array[array.findIndex(k => k.edition == randomIndex)].edition = array[array.findIndex(k => k.edition == currentElement.edition)].edition;
array[array.findIndex(k => k.edition == currentElement.edition)].edition = temp;
});
fs.writeFileSync(
`${basePath}/build/json/_metadata.json`,
JSON.stringify(array, null, 2)
); For me it doesn't look like it's even shuffling images. |
I can see shuffling in _metadata.json file but it is not matching with the image layers, Looks like _metadata.json is shuffled with other random values. |
I have created shuffle.js in the utils package and pasted this piece of code in it. Running with the command line shuffles individual images and metadata.json but JSON shuffling is not matching with shuffled image layers. node utils/shuffle.js |
@bolshoytoster did you find anything? Please help. |
@santosh-kumar-kaushal no, sorry, you could try fixing it yourself though. |
I don't have exposure to python but I tried it. unfortunately, it didn't work. |
1st Base character and 30 Layers generate = 1000 NFT
2nd Base character and 25 Layers generate = 1000 NFT
3nd Base character and 35 Layers generate = 1000 NFT
Now we have 3000, can we jumble the numbers in the collection for images and JSON files?
Need help! Thanks in advance.
The text was updated successfully, but these errors were encountered: