Pipeline Planning
For this collection we have 3 Different Trait types. We can combine our separate meshes into a unified mesh for each trait type, and apply the appropriate material. We end up having 1 mesh object for each trait in our outliner.
In order to export unique avatars we will want to only enable the meshes that make up a specific token. We can create a python script in Blender that reads in the JSON we created earlier and enable and disable visibility to export specific token glbs.
The easiest way to do this would be to enforce a naming convention when creating meshes in the outliner something like:
{trait_type}_{trait_name}
i.e.
head_smiley_face
So the general steps would be:
Read in collection metadata
Loop through each token
hide all meshes
enable meshes from token metadata
export GLB from Blender.
run the exported GLB through the Avatar Tools CLI
Installing Avatar Tools CLI
Download the standalone Binary for node.js v20.11.1
Extract the .zip and place it in a folder relative to your blender file
Change the folder name from
node-v20.*tonode_binDownload the
.zipfrom https://github.com/mml-io/avatar-tools

open up a terminal and change the directory to the folder you just extracted i.e.
cd /path/to/avatar-tools-mainadd
node_bintoPATHWindows
set PATH=..\node_bin;%PATH%Mac/Linux
export PATH=../node_bin;$PATH
run
npm installrun
npm run build --workspace packages --workspace clis --workspace tools
Below is a very basic script that can be run within Blender to export all avatars for a collection. There is plenty of room for improvement to fit specific needs and workflows but this should give a foundational look at how to create a simple process for generating all unique avatars.
Last updated

