Skip to content

Conversation

bruceballad
Copy link

@bruceballad bruceballad commented Oct 24, 2021

Hi, I tried to fix and improve this modified version of hashlips_art_engine. And I wanted to share my personal "improvements". However, I have never created a fork or opened a pull request before. So, please excuse the weird commits.

Notable Changes;

  • [Fixed] A small bug with resetNameIndex functionality that breaks the numbers when it is used after second layer config set.
  • [Added] The ability to add a suffix after the number in the edition name. Now, if there is a suffix, 'resetNameIndex=true' option adds the sub-index counter number after the suffix. So, you can form names like; "PREFIX #10 - SUFFIX #2". (If there is no suffix set, resetNameIndex works as originally intended)
  • [Added] The ability to set custom descriptions for each layer config set.
  • [Added] The ability to prepend custom descriptions for each layer config set. So, you can form unique descriptions like; "Item #10 is an art piece from Collection X".
  • [Added] External_url config for OpenSea.
  • [Added] Some sample extraAttributes to be used as templates based on OpenSea metadata-standards.

[Fix] There is a small bug with resetNameIndex functionality that breaks the numbers when it is used after the second layer config set. Changing the "+=" to "=" at the line 556 seems to fix it.
- [Added] The ability to add a suffix after the number in the edition name. Now, if there is a suffix, 'resetNameIndex=true' option adds the sub-index counter number after the suffix. So, you can form names like; "PREFIX nftchef#10 - SUFFIX #2". (If there is no suffix set, resetNameIndex works as originally intended)
- [Added] The ability to set custom descriptions for each layer config set.
- [Added] The ability to prepend custom descriptions for each layer config set. So, you can form unique descriptions like; "Item nftchef#10 is an art piece from Collection X".
- [Added] External_url config for OpenSea.
- [Added] Some sample extraAttributes to be used as templates based on OpenSea metadata-standards.
- [Added] The ability to add a suffix after the number in the edition name. Now, if there is a suffix, 'resetNameIndex=true' option adds the sub-index counter number after the suffix. So, you can form names like; "PREFIX nftchef#10 - SUFFIX #2". (If there is no suffix set, resetNameIndex works as originally intended)
- [Added] The ability to set custom descriptions for each layer config set.
- [Added] The ability to prepend custom descriptions for each layer config set. So, you can form unique descriptions like; "Item nftchef#10 is an art piece from Collection X".
- [Added] External_url config for OpenSea.
- [Added] Some sample extraAttributes to be used as templates based on OpenSea metadata-standards.
A new utility script to remove a top level data from metadata files. It is created by modifying removeTrait.js utility.

This utility can be used for removing unwanted top level data from json files.
You can remove a data you may not need in your project,  such as "dna" or "external_url".

Use by running the following command;
```
node utils/removeMetadataContent.js "Background"
```

or for additional logging, use with the `-d` flag
```
node utils/removeMetadataContent.js "Background" -d
```
@nftchef
Copy link
Owner

nftchef commented Oct 26, 2021

Thank you for this! sorry it took a while to see it!
I will review it as soon as possible. Would you mind reaching out to me on Discord genkihagata#3074 or twitter @NFTChef

Thank you!

Copy link
Owner

@nftchef nftchef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the PR! I left a few comments for changes before I can merge this in 🙇‍♂️

Copy link
Author

@bruceballad bruceballad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with all your comments.
I will make the changes as soon as I have some time.

This file name was preventing GitHub Desktop app from cloning the repo.
I know this name was experimental.
I could not try renaming it on the website too. So, I need to remove it for now.
#config.js
-	The sample text of `const description =` property is returned to how it was previously.
-	`prependNameInDescription` property is removed as we now replace `{name}` key in the text for embeding names in the text anywhere we want, not only prepend.
-	The order of new properties added to the sample layer config groups are ordered for a better merge and easy reading.
-	Additional `extraAttributes` examples are removed.

#main.js
-	String combining in asset name and description texts are now all by the proper use of template strings.
-	The functions that asset names and descriptions are built are moved to a better place to reduce repeating codes.
-	Instead of passing `_prefix`, `_offset`, and `_suffix`, separately and using these during metadata writing, they are now being passed to metadata builder as just `_name`.
-	The check and switch for `_descriptionOverwrite` is now done before the description is passed to metadata builder as `_description`.
-	`_prependNameInDescription` propery is removed. Now names get embeded in the text with RegExp replacing the `{name}` key before passing the `_description` text to metadata.

#README.md
-	Explanations and examples for the new `suffix` and `descriptionOverwrite` properties are added. In the `# Name + Number prefix, suffix, and counter reset for configuration sets` section (the title is modified too).
-	A new section for `Remove Metadata Content` utility is added for directives on how to use this utility.

#3shadow_blend=multiply&opacity=50.png
-	This file name was preventing GitHub Desktop app from cloning the repo to a local disk. It was only removed for the cloning step. Now it is being added back to match the source.
@bruceballad bruceballad requested a review from nftchef October 29, 2021 14:13
Deleted a leftover comment line.
Added a small check for the outputJPEG setting.
Now it can pull images with .jpg extension to create preview collage too.
Removed a leftover "_offset" console message while generating images.
Added "name" info in the "Created edition: #" messages in console for better reports. This will allow following prefix, suffix. and offset number changes while generating images.
The baseUri util was always making the file extension in URLs ".png".
Added a small check for the outputJPEG setting.
Now it can update baseUri and write ".jpg" or ".png" based on the config outputJPEG setting.
manual update reflecting the last commit made by @nftchef

nftchef@2e9d74e
Just changed counter reset to 'true' for the second sample layerconfig set.
@matbrgz
Copy link

matbrgz commented Dec 26, 2023

Is it possible to merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants