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

TypeError: Cannot read property 'path' of undefined #61

Closed CryptoDynasty closed 2 years ago

CryptoDynasty commented 2 years ago

This is probably something simple I am missing. I changed all the folder names in the input directory and added all my artwork to the corresponding folders. Original, Rare, Super rare. I also added "rare and super rare" to the image names of the corresponding images.

Removed two folders and only kept 4, this is what I renamed them. accessories eyes horns skins

In the config.js at line 144 I made these changes.

// create required layers // for each layer, call 'addLayer' with the id and optionally the positioning and size // the id would be the name of the folder in your input directory, e.g. 'ball' for ./input/ball const layers = [ addLayer('accessories', { x: 0, y: 0 }, { width: width, height: height }), addLayer('eyes'), addLayer('horns'), addLayer('skins') ];

// provide any specific percentages that are required for a given layer and rarity level // all provided options are used based on their percentage values to decide which layer to select from addRarityPercentForLayer('super_rare', 'eyes', { 'super_rare': 33, 'rare': 33, 'original': 33 }); addRarityPercentForLayer('super_rare', 'skin', { 'super_rare': 50, 'rare': 25, 'original': 25 }); addRarityPercentForLayer('original', 'skin', { 'super_rare': 50, 'rare': 25, 'original': 25 });

When I type: "node index.js" this is the error I get. Can anyone please help. Thanks. HelpPlease

CryptoDynasty commented 2 years ago

I found my issue. Can anyone tell me what I edit to make the default background colors be specific ones I choose instead of random colors?

EvilShaggz commented 2 years ago

I just created a folder called backgrounds and added block colour png to it and made it the first layer added

CryptoDynasty commented 2 years ago

Thanks!

massouji82 commented 2 years ago

@CryptoDynasty what was the issue sir? I'm having the same problem.