Deprecated: Creation of dynamic property NewFoldLabs\WP\Module\MyProducts\ProductsApi::$namespace is deprecated in /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php on line 41

Deprecated: Creation of dynamic property NewFoldLabs\WP\Module\MyProducts\ProductsApi::$rest_base is deprecated in /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home4/sydasyst/public_html/mirkgenerative/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home4/sydasyst/public_html/mirkgenerative/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home4/sydasyst/public_html/mirkgenerative/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home4/sydasyst/public_html/mirkgenerative/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home4/sydasyst/public_html/mirkgenerative/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home4/sydasyst/public_html/mirkgenerative/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home4/sydasyst/public_html/mirkgenerative/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home4/sydasyst/public_html/mirkgenerative/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home4/sydasyst/public_html/mirkgenerative/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":110,"date":"2022-08-27T21:44:09","date_gmt":"2022-08-27T21:44:09","guid":{"rendered":"https:\/\/mirkgenerative.com\/?p=110"},"modified":"2022-08-27T21:44:14","modified_gmt":"2022-08-27T21:44:14","slug":"managing-nft-attributes-in-processing","status":"publish","type":"post","link":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/","title":{"rendered":"Managing NFT Attributes in Processing"},"content":{"rendered":"\n

I made it through eight months of working on generative art before I realized that there’s a HUGE part of NFTs that I was missing… attributes[]. Shoot! What a bummer! Nevermind that when I came over from PHP\/js only experience I wasn’t using arrays or array lists in Processing. The FIRST THING I should have done was figure out how to track and store attribute data in my work. Well, that’s how I feel now. The journey’s really been about figuring out how to art with code. This would have been a “smarter” way to go about managing the variability\/variety\/permutations in my art from the get go.<\/p>\n\n\n\n\n\n\n\n

Yes. Attributes are an important part of NFT listings and series–particularly in the generative space. (Looking at you, objkt.io >:-O.) But managing variability is an important part of the generative art process as it stands. Either way, managing attributes\/variety can only help improve how you develop and work on your generative art piece.<\/p>\n\n\n\n

\"\"
Screenshot of early project code<\/figcaption><\/figure>\n\n\n\n

When I Started…<\/h2>\n\n\n\n

my first project I was thinking about a general theme, but also about how I could make things different about each iteration of the algorithm. These days I use my sketch book to write down my initial ideas, but originally I actually used a spreadsheet to track all the different elements of the piece that I wanted to be different. I’m a spreadsheet person, so I actually built out most of the initial variability and modeled it in the spreadsheet. <\/p>\n\n\n\n

I took that spreadsheet and started initializing variables, calculating derivative variables, etc. (As you can see above, I wanted to make similar colors that were still pretty random.) While the project progressed I added more and more features and functionality to the program. By the end of it (actually, eight months later when I started using that project to figure out how to mint NFTs) I realized I had no idea which of the variables in this (80 lines of code) mess were key to the variability of the art. Enter my new framework.<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n

From Now On…<\/h2>\n\n\n\n

I figure we can skip the “How I Dug Attributes Out of My Processing Code” post and go straight to the point. Attributes have the following consistent format in the NFT world:<\/p>\n\n\n\n

\/\/array of attributes, stored inside the IPFS JSON metadata:\n<\/mark>{\n  \"attributes\": [\n    {\n      \"name\": \"attribute\",\n      \"value\": \"some value\"\n     },\n    {\n      \"name\": \"integer attribute\",\n      \"value\": 4\n    }\n  ]\n}<\/code><\/pre>\n\n\n\n

Hooray for code blocks! One thing: Open Sea uses “trait_type” and OBJKT uses “name”. Until I get to where I feel like I can burn ETH on gas, I’ll be working with XTZ and sticking to “name”.<\/p>\n\n\n\n

While Java lets you do things like use a Map object and HashMap, the way that feels the best to me is this (I’ll try to update it if\/when this changes and I’m open to feedback! [mayChange]<\/sub>):<\/p>\n\n\n\n

1. <\/strong>I create an attributes ArrayList with the type JSONObject.<\/p>\n\n\n\n

ArrayLIst<JSONObject> attributes;<\/code><\/code><\/pre>\n\n\n\n

2. <\/strong>In Processing I can write two functions that can package the attribute JSON and add it to the ArrayList like this:<\/p>\n\n\n\n

void addStringAttribute(String name, String value) {\n  JSONObject tempJSON = new JSONObject();\n  tempJSON.setString(\"name\",name);\n  tempJSON.setString(\"value\",value);\n  attributes.add(tempJSON);\n}<\/code><\/pre>\n\n\n\n

The tempJSON object this creates then looks something like this:<\/p>\n\n\n\n

{\n  \"name\": \"attribute_name\",\n  \"value\": \"attribute_value\"\n}<\/code><\/pre>\n\n\n\n

3. <\/strong>When I set a variable that will be a project attribute (is key to the variability of the piece), I call my functions to add those strings\/integers to the JSONObject array list.<\/p>\n\n\n\n

addStringAttribute(\"attribute_name\", attribute);\naddIntAttribute(\"attrubute_name\",attribute)<\/span>;<\/span><\/code><\/code><\/code><\/pre>\n\n\n\n

I’m sure this seems pretty simple to the old-hands in art on chain generative art. But this was a great opportunity to push myself into thinking more clearly about NFT attribute management and NFT attribute storage.<\/p>\n","protected":false},"excerpt":{"rendered":"

I made it through eight months of working on generative art before I realized that there’s a HUGE part of NFTs that I was missing… attributes[]. Shoot! What a bummer! Nevermind that when I came over from PHP\/js only experience I wasn’t using arrays or array lists in Processing. The FIRST THING I should have … Continue reading Managing NFT Attributes in Processing<\/span> →<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","WB4WB4WP_MODE":"","WB4WP_PAGE_SCRIPTS":"","WB4WP_PAGE_STYLES":"","WB4WP_PAGE_FONTS":"","WB4WP_PAGE_HEADER":"","WB4WP_PAGE_FOOTER":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13],"tags":[16,12,11,15],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-notebook","tag-attributes","tag-java","tag-processing","tag-variables"],"yoast_head":"\nManaging NFT Attributes in Processing - mirkGenerative<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Managing NFT Attributes in Processing - mirkGenerative\" \/>\n<meta property=\"og:description\" content=\"I made it through eight months of working on generative art before I realized that there’s a HUGE part of NFTs that I was missing… attributes[]. Shoot! What a bummer! Nevermind that when I came over from PHP\/js only experience I wasn’t using arrays or array lists in Processing. The FIRST THING I should have … Continue reading Managing NFT Attributes in Processing →\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/\" \/>\n<meta property=\"og:site_name\" content=\"mirkGenerative\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-27T21:44:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-27T21:44:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mirkgenerative.com\/wp-content\/uploads\/2022\/08\/image.png\" \/>\n<meta name=\"author\" content=\"adam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"adam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/\",\"url\":\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/\",\"name\":\"Managing NFT Attributes in Processing - mirkGenerative\",\"isPartOf\":{\"@id\":\"https:\/\/mirkgenerative.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mirkgenerative.com\/wp-content\/uploads\/2022\/08\/image.png\",\"datePublished\":\"2022-08-27T21:44:09+00:00\",\"dateModified\":\"2022-08-27T21:44:14+00:00\",\"author\":{\"@id\":\"https:\/\/mirkgenerative.com\/#\/schema\/person\/2d442880f3241dd67f31bb2fa16e7f0f\"},\"breadcrumb\":{\"@id\":\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/mirkgenerative.com\/wp-content\/uploads\/2022\/08\/image.png?fit=467%2C802&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/mirkgenerative.com\/wp-content\/uploads\/2022\/08\/image.png?fit=467%2C802&ssl=1\",\"width\":467,\"height\":802},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mirkgenerative.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Managing NFT Attributes in Processing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mirkgenerative.com\/#website\",\"url\":\"https:\/\/mirkgenerative.com\/\",\"name\":\"mirkGenerative\",\"description\":\"a journey into generative art and NFTs\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mirkgenerative.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/mirkgenerative.com\/#\/schema\/person\/2d442880f3241dd67f31bb2fa16e7f0f\",\"name\":\"adam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mirkgenerative.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8cb4ad391b53bc09a02eb5ebb399b41e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8cb4ad391b53bc09a02eb5ebb399b41e?s=96&d=mm&r=g\",\"caption\":\"adam\"},\"url\":\"https:\/\/mirkgenerative.com\/author\/amirkovich\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Managing NFT Attributes in Processing - mirkGenerative","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/","og_locale":"en_US","og_type":"article","og_title":"Managing NFT Attributes in Processing - mirkGenerative","og_description":"I made it through eight months of working on generative art before I realized that there’s a HUGE part of NFTs that I was missing… attributes[]. Shoot! What a bummer! Nevermind that when I came over from PHP\/js only experience I wasn’t using arrays or array lists in Processing. The FIRST THING I should have … Continue reading Managing NFT Attributes in Processing →","og_url":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/","og_site_name":"mirkGenerative","article_published_time":"2022-08-27T21:44:09+00:00","article_modified_time":"2022-08-27T21:44:14+00:00","og_image":[{"url":"https:\/\/mirkgenerative.com\/wp-content\/uploads\/2022\/08\/image.png"}],"author":"adam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"adam","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/","url":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/","name":"Managing NFT Attributes in Processing - mirkGenerative","isPartOf":{"@id":"https:\/\/mirkgenerative.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#primaryimage"},"image":{"@id":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#primaryimage"},"thumbnailUrl":"https:\/\/mirkgenerative.com\/wp-content\/uploads\/2022\/08\/image.png","datePublished":"2022-08-27T21:44:09+00:00","dateModified":"2022-08-27T21:44:14+00:00","author":{"@id":"https:\/\/mirkgenerative.com\/#\/schema\/person\/2d442880f3241dd67f31bb2fa16e7f0f"},"breadcrumb":{"@id":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#primaryimage","url":"https:\/\/i0.wp.com\/mirkgenerative.com\/wp-content\/uploads\/2022\/08\/image.png?fit=467%2C802&ssl=1","contentUrl":"https:\/\/i0.wp.com\/mirkgenerative.com\/wp-content\/uploads\/2022\/08\/image.png?fit=467%2C802&ssl=1","width":467,"height":802},{"@type":"BreadcrumbList","@id":"https:\/\/mirkgenerative.com\/notebook\/managing-nft-attributes-in-processing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mirkgenerative.com\/"},{"@type":"ListItem","position":2,"name":"Managing NFT Attributes in Processing"}]},{"@type":"WebSite","@id":"https:\/\/mirkgenerative.com\/#website","url":"https:\/\/mirkgenerative.com\/","name":"mirkGenerative","description":"a journey into generative art and NFTs","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mirkgenerative.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/mirkgenerative.com\/#\/schema\/person\/2d442880f3241dd67f31bb2fa16e7f0f","name":"adam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mirkgenerative.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8cb4ad391b53bc09a02eb5ebb399b41e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8cb4ad391b53bc09a02eb5ebb399b41e?s=96&d=mm&r=g","caption":"adam"},"url":"https:\/\/mirkgenerative.com\/author\/amirkovich\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/posts\/110"}],"collection":[{"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":3,"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":213,"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/posts\/110\/revisions\/213"}],"wp:attachment":[{"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mirkgenerative.com\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}