HashLips / generative-art-opensource

Create generative art by using the canvas api and node js, feel free to contribute to this repo with new ideas.
MIT License
1.36k stars 695 forks source link

Merging two collections with separate layers (eg. Female/Male) #137

Open NetworkEntity opened 2 years ago

NetworkEntity commented 2 years ago

I've built two projects each which successfully creates 5k images, i've gave each a unique DNAprefix and started the second collection with ID 5001 - 10k which gives me 10k images with correct metadata and rarity specifications.

However i'm looking at how to combine both input directories into one project so that a generation of 10k images would give me a randomisation of both sets in the same export (as opposed to 1-5k being male, 5-10k being female etc).

Each project has its own X/Y layout in the original .png layers, so i need to programme to run two separate sets of layers at random each taking layers from their own input directory.

Any thoughts, feedback, directions or suggestions appreciated.

vagueink commented 2 years ago

Treat the sex as the race variable and configure all your weights in each attribute tree. You will need to use v3 o v4 code to accomplish this.

NetworkEntity commented 2 years ago

Yeah i tried using v.3 but it's nowhere as clean for rarity generation as main. I have a two 5k collections that are great, male and female, but i need to combine them into the same export and make the generation of each race random. m/m/f/m/f/f/f/m/m/f/m/f/m/m etc

tdr357 commented 2 years ago

const getRace = (_editionCount) => { let race = "No Race"; if (Math.random() > 0.3) { race = "HumanMale" } else { race = "HumanFemale" } return race; };

PS: If you have code to stop overlapping layers eg: IF Mask THEN No CIG. I'd appreciate some help in return! The code i've supplied will be placed in Index.js :)

NetworkEntity commented 2 years ago

const getRace = (_editionCount) => {

let race = "No Race";

if (Math.random() > 0.3) {

race = "HumanMale"

} else {

race = "HumanFemale"

}

return race;

};

PS: If you have code to stop overlapping layers eg: IF Mask THEN No CIG. I'd appreciate some help in return! The code i've supplied will be placed in Index.js :)

Does this work on Hashlips Art Engine? This is exactly what I need but the layer function runs differently on that code.

tdr357 commented 2 years ago

const getRace = (_editionCount) => { let race = "No Race"; if (Math.random() > 0.3) { race = "HumanMale" } else { race = "HumanFemale" } return race; }; PS: If you have code to stop overlapping layers eg: IF Mask THEN No CIG. I'd appreciate some help in return! The code i've supplied will be placed in Index.js :)

Does this work on Hashlips Art Engine? This is exactly what I need but the layer function runs differently on that code.

v3

joggytime1 commented 2 years ago

What was the easiest way to change the collection id to 5000, etc.

Thanks.