You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go to the root of you folder and run this command if you have yarn installed.
23
28
29
+
```sh
24
30
yarn add all
25
31
```
26
32
33
+
Alternativly you can run this command if you have node installed.
34
+
35
+
```sh
36
+
npm install
37
+
```
38
+
27
39
## Usage
28
40
29
-
Create your different layers as folders in the 'layers' directory, and add all the layer assets in these directories. You can name the assets anything as long as it has a rarity weight attached in the file name like so: `example element*70.png`
41
+
Create your different layers as folders in the 'layers' directory, and add all the layer assets in these directories. You can name the assets anything as long as it has a rarity weight attached in the file name like so: `example element#70.png`. You can optionally change the delimiter `#` to anything you would like to use in the variable `rarityDelimiter` in the `src/config.js` file.
30
42
31
-
Once you have all your layers, go into `src/config.js` and update the `layersOrder` array to be your layer folders name in order of the back layer to the front layer.
43
+
Once you have all your layers, go into `src/config.js` and update the `layerConfigurations` objects `layersOrder` array to be your layer folders name in order of the back layer to the front layer.
32
44
33
-
*Example:* If you were creating a portrait design, you might have a background, then a head, a mouth, eyes, eyewear, and then headwear, so your `layersOrder` would look something like this:
45
+
_Example:_ If you were creating a portrait design, you might have a background, then a head, a mouth, eyes, eyewear, and then headwear, so your `layersOrder` would look something like this:
34
46
35
47
```js
36
-
constlayersOrder= [
37
-
{ name:'Background'},
38
-
{ name:'Ball'},
39
-
{ name:'Eye color' },
40
-
{ name:'Iris' },
41
-
{ name:'Shine' },
42
-
{ name:'Bottom lid' },
43
-
{ name:'Top lid' },
48
+
constlayerConfigurations= [
49
+
{
50
+
growEditionSizeTo:100,
51
+
layersOrder: [
52
+
{ name:"Head" },
53
+
{ name:"Mouth" },
54
+
{ name:"Eyes" },
55
+
{ name:"Eyeswear" },
56
+
{ name:"Headwear" },
57
+
],
58
+
},
44
59
];
45
60
```
46
61
47
-
The `name` of each layer object represents the name of the folder (in `/layers/`) that the images reside in.
62
+
The `name` of each layer object represents the name of the folder (in `/layers/`) that the images reside in.
63
+
64
+
Optionally you can now add multiple different `layerConfigurations` to you collection. Each confugiration can be uinque and have different layer order, use the same layers or intruduce new onces. This gives the artist flexibility when it comes to fine tuning their collections to their needs.
65
+
66
+
_Example:_ If you were creating a portrait design, you might have a background, then a head, a mouth, eyes, eyewear, and then headwear and you want to create a new race or just simple re-order the layers or even introduce new layers, so your `layerConfigurations` and `layersOrder` would look something like this:
67
+
68
+
`````js
69
+
constlayerConfigurations= [
70
+
{
71
+
// Creates upto 50 artworks
72
+
growEditionSizeTo:50,
73
+
layersOrder: [
74
+
{ name:"Background" },
75
+
{ name:"Head" },
76
+
{ name:"Mouth" },
77
+
{ name:"Eyes" },
78
+
{ name:"Eyeswear" },
79
+
{ name:"Headwear" },
80
+
],
81
+
},
82
+
{
83
+
// Creates an aditional 100 artworks
84
+
growEditionSizeTo:150,
85
+
layersOrder: [
86
+
{ name:"Background" },
87
+
{ name:"Head" },
88
+
{ name:"Eyes" },
89
+
{ name:"Mouth" },
90
+
{ name:"Eyeswear" },
91
+
{ name:"Headwear" },
92
+
{ name:"AlienHeadwear" },
93
+
],
94
+
},
95
+
];
96
+
```
48
97
49
-
Then optionally, update your `format` size, ie the outputted image size, and the `editionSize`, which is the amount of variation outputted.
98
+
Then optionally, update your `format` size, ie the outputted image size, and the `growEditionSizeTo` on each `layerConfigurations` object, which is the amount of variation outputted.
50
99
51
100
When you are all ready, run the following command and your outputted art will be in the `build` directory:
52
101
53
102
```sh
54
103
npm run build
55
104
```
105
+
106
+
or
107
+
108
+
```sh
109
+
node index.js
110
+
```
111
+
112
+
The program will output all the images in the `build` directory along with the metadata files. Each collection will have a `_metadata.json` file that consists of all the metadata in the collection inside the `build`folder. The`build` folder also will contain alll the images as well as single json files that represents each image file. The single json file of a image will look somthing like this:
113
+
114
+
````json
115
+
{
116
+
"dna":"d956cdf4e460508b5ff90c21974124f68d6edc34",
117
+
"name":"#1",
118
+
"description":"This is the description of your NFT project, remember to replace this",
119
+
"image":"https://hashlips/nft/1.png",
120
+
"edition":1,
121
+
"date":1631690799975,
122
+
"attributes": [
123
+
{ "trait_type":"Background", "value":"Black" },
124
+
{ "trait_type":"Eyeball", "value":"Red" },
125
+
{ "trait_type":"Eye color", "value":"Yellow" },
126
+
{ "trait_type":"Iris", "value":"Small" },
127
+
{ "trait_type":"Shine", "value":"Shapes" },
128
+
{ "trait_type":"Bottom lid", "value":"Low" },
129
+
{ "trait_type":"Top lid", "value":"Middle" }
130
+
],
131
+
"compiler":"HashLips Art Engine"
132
+
}
133
+
```
134
+
135
+
Thats it, your done. Hope you create some awesome artworks withthis code.
0 commit comments