nftchef / art-engine

An advanced fork of the HashLips Art Engine with additional features to generate complex art from provided layers using the familiar Hashlips setup.
MIT License
427 stars 203 forks source link

Path error when using RarityData.js #211

Closed BarryDB83 closed 2 years ago

BarryDB83 commented 2 years ago

I use nested folder for my bases, but when I try to run the rarity tool I get a scandir error because the path is wrong. It somehow omits the base parent folder.

Changing useRootTraitType makes no difference.

Example below, the correct path should be '/Users/XXX/Desktop/XXX/Art Engine/layers/Base/Base-1#15/Eyes/'

/Users/XXX/Desktop/XXX/Art Engine/src/config.js node:internal/fs/utils:347 throw err; ^

Error: ENOENT: no such file or directory, scandir '/Users/XXX/Desktop/XXX/Art Engine/layers/Base-1#15/Eyes/' at Object.readdirSync (node:fs:1450:3) at getElements (/Users/XXX/Desktop/XXX/Art Engine/src/main.js:149:6) at /Users/XXX/Desktop/XXX/Art Engine/utils/rarityData.js:80:20 at Array.forEach () at /Users/XXX/Desktop/XXX/Art Engine/utils/rarityData.js:77:13 at Array.forEach () at Object. (/Users/XXX/Desktop/XXX/Art Engine/utils/rarityData.js:33:21) at Module._compile (node:internal/modules/cjs/loader:1112:14) at Module._extensions..js (node:internal/modules/cjs/loader:1166:10) at Module.load (node:internal/modules/cjs/loader:988:32) { errno: -2, syscall: 'scandir', code: 'ENOENT', path: '/Users/XXX/Desktop/XXX/Art Engine/layers/Base-1#15/Eyes/' }

Node.js v18.4.0

BarryDB83 commented 2 years ago

I was able to get it working with the updated rarity.js in the utils/rarity tree.

Make sure to download the file correctly, right clicking and downloading it will give you an HTML document and won't work.