Logo

metacells

metacells is a generative art project and framework capable of creating all the necessary assets for an off-chain NFT project.
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact

About The Project

Preview image

metacells is a generative art framework built with TouchDesigner that allows fast creation of multiple video assets for minting as NFTs. Each asset is the result of controlled randomness within the framework. It uses the inherent modularity of TouchDesigner to create multiple components that are each responsible for one single thing.

The modules creating the generative art (base_layer) are all structured around a noise component where the local seed is being adjusted randomly by a master seed. All parameters for the various elements in the module are set in a table and set by this local noise.

The master seed is set randomly at every (rendering) timeline pass of the project, hence setting random values in each local module. It also switches between each base_layer, creating a different rendering each time the project is ran.

The project is structured as follows (under root module & folder src):

  • common - a set of utilities for the project
  • execute_startup - runs every time the project is started:
    • Assigns the master seed to each local seed in the base_layer
    • Collects all base_layer in a dictionary for easy retrieval of parameters
    • Sets the local noise resolution to the number of parameters
    • Connects each noise pixel value to their corresponding layer via expressions
  • execute_rendering - creates three different types of assets on rendering (image sequences, video files and their corresponding sha256-hash):
    • Removes the real-time flag to render
    • Caches the rendering for seamless looping on first timeline pass
    • Renders a still image sequence on second timeline pass
    • Renders asynchronously a video file of this image sequence
    • And ends with creating a sha256-hash of that video file for asset verification at a later stage
  • base_col_pal - generates a library of 900 different color palettes for easy access
  • container_ui - hosts all necessary components to create the control ui for render purposes
  • base_layer_x - contains all necessary elements to create a generative art piece:
    • A select2 texture selector which pulls the base_layer_0 output texture
    • A select3 texture selector which pulls the color palette generated by base_col_pal
    • A noise1 which is the local noise module which sets all parameters in the module in a random manner
    • A set of tables and mathematical expressions to map the range of the noise1 range [0-1] to a specific range needed by the module
    • Those elements above are contained in every base_layer as a template - the rest of the components are created locally and are different for each module

(back to top)

Built With

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

A good knowledge of the TouchDesigner environment, and its python scripting language is recommended if the usage exceeds the simple task of rendering the assets.

An installation of TouchDesigner is necessary. Python is already included in this framework (3.7 at the time of writing). This project was created using TD version 2021.17270. It will work on higher versions, the inverse might not necessarily be true.

This project is released for the Win-x64 platform. It might work with some adjustments on an OSX platform.

Installation

  1. Download TouchDesigner and install it.
  2. Create an account in order to generate a free licence key (free licences are restricted to non-commercial usage, and have a max texture resolution of 1280x1280)
  3. Clone this repo
git clone https://github.com/somaticbits/metacells.git
  1. Enter the metacells folder
  2. Download ffmpeg to this folder
  3. Unarchive the downloaded zip file and rename the folder ffmpeg
  4. Start the project by clicking on metacells.toe

(back to top)

Usage

Basic usage of the project is to open the metacells.toe file and click on render.

Through it's modularity, the project can be extended with an unlimited amount of base_layer, allowing the random generation of multiple assets.

Extension of the project would be working the in following way:

  • Copy _base_layer_template and rename to the latest layer number (*ex: if last layer is base_layer_10, rename the new layer base_layer_11)
  • Build that module out and gather all parameters that can be modulated
  • Copy base_layer_x folder in the project root folder (src)
  • Populate table_pars.py inside that base_layer_x folder with chosen parameters - it has its own taxonomy (see below)
  • Once this is done, restart the project so all new parameters can be set up by the system (Alternativately, you can restart the parameter set up by clicking the restart button in the container_debug module).

table_pars.py is a csv file that has following headers: par_name / op / par / min / max

  • par_name: the name of the parameter - can be chosen freely (ex: pos_seed - corresponds to the seed of the noise position module)
  • op: the exact name of the specified module (ex: noise_pos - the noise position module)
  • par: the exact name of the parameter inside the module (ex: seed - seed parameter of the noise position module)
  • min: the minimum range for this specific parameter (ex: 0 - can be set as int or float types)
  • max: the maximum range for this specific parameter (ex: 9000 - can be set as int or float types)

For more examples, please refer to the Documentation

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

David Pettersson - @somaticbits - david@somaticbits.com

Project Link: https://github.com/somaticbits/metacells

(back to top)