diff --git a/README.md b/README.md index 98a393c2e..6b1804d6f 100644 --- a/README.md +++ b/README.md @@ -101,10 +101,43 @@ const layerConfigurations = [ ]; ``` -Update your `format` size, ie the outputted image size, and the `growEditionSizeTo` on each `layerConfigurations` object, which is the amount of variation outputted. +Update your `format` size, (i.e. the outputted image size, and the `growEditionSizeTo` on each `layerConfigurations` object), which is the amount of variation outputted. You can mix up the `layerConfigurations` order on how the images are saved by setting the variable `shuffleLayerConfigurations` in the `config.js` file to true. It is false by default and will save all images in numerical order. +If you want a custom edition offset for your layer configuration, you can specify an `editionOffset` in the _first_ `layerConfiguration` object. + +_Example:_ You already generated collection of `120` NFTs and want to start generating more NFTs as a continuation of the collection. + +```js +const layerConfigurations = [ + { + editionOffset: 121, // start from 121 + growEditionSizeTo: 100, // will generate 100 nfts named 121 - 220 + layersOrder: [ + { name: "Head" }, + { name: "Mouth" }, + { name: "Eyes" }, + { name: "Eyeswear" }, + { name: "Headwear" }, + ], + }, + { + // Creates an additional 100 artworks numbered 221 - 370 + growEditionSizeTo: 150, + layersOrder: [ + { name: "Background" }, + { name: "Head" }, + { name: "Eyes" }, + { name: "Mouth" }, + { name: "Eyeswear" }, + { name: "Headwear" }, + { name: "AlienHeadwear" }, + ], + }, +]; +``` + If you want to have logs to debug and see what is happening when you generate images you can set the variable `debugLogs` in the `config.js` file to true. It is false by default, so you will only see general logs. If you want to play around with different blending modes, you can add a `blend: MODE.colorBurn` field to the layersOrder `options` object. diff --git a/src/config.js b/src/config.js index c46d867a0..86149e95f 100644 --- a/src/config.js +++ b/src/config.js @@ -24,7 +24,8 @@ const solanaMetadata = { // If you have selected Solana then the collection starts from 0 automatically const layerConfigurations = [ { - growEditionSizeTo: 5, + //editionOffset: 11, // You can set this to start numbering from a custom offset other than the default which is 1 + growEditionSizeTo: 15, layersOrder: [ { name: "Background" }, { name: "Eyeball" }, diff --git a/src/main.js b/src/main.js index e9c08dcf2..3579dfcfc 100644 --- a/src/main.js +++ b/src/main.js @@ -339,9 +339,19 @@ const startCreating = async () => { let editionCount = 1; let failedCount = 0; let abstractedIndexes = []; + if (layerConfigurations.length === 0) { + throw new Error("No layer configurations found in config.js"); + } + const editionOffset = + layerConfigurations[0].editionOffset && + layerConfigurations[0].editionOffset >= 1 + ? layerConfigurations[0].editionOffset - 1 + : 0; + const collectionSize = + layerConfigurations[layerConfigurations.length - 1].growEditionSizeTo; for ( - let i = network == NETWORK.sol ? 0 : 1; - i <= layerConfigurations[layerConfigurations.length - 1].growEditionSizeTo; + let i = editionOffset + (network == NETWORK.sol ? 0 : 1); + i <= editionOffset + collectionSize; i++ ) { abstractedIndexes.push(i); @@ -405,9 +415,13 @@ const startCreating = async () => { addMetadata(newDna, abstractedIndexes[0]); saveMetaDataSingleFile(abstractedIndexes[0]); console.log( - `Created edition: ${abstractedIndexes[0]}, with DNA: ${sha1( - newDna - )}` + `${`${ + editionOffset > 0 + ? abstractedIndexes[0] - editionOffset + : abstractedIndexes[0] + }`.padStart(Math.log(collectionSize), " ")} > Created edition: ${ + abstractedIndexes[0] + }, with DNA: ${sha1(newDna)}` ); }); dnaList.add(filterDNAOptions(newDna));