DEV Community

Discussion on: Create NFT 3D Collectibles Using Blender Scripting

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
hideckies profile image
hideckies

Hi,

How do I make it so that it uses the second character only if a t-shirt is selected to be displayed?

Such a case, you can add the optional code after random.choice() in gen_metadata.py

def rand_attributes(id):
    # ...
    random_model = random.choice(...
    random_clothes = random.choice(...

    # Add it!
    if random_clothes == "t-shirts":
        random_model = "another"    # assumed that the model names are "original" and "another"

    # ...
    random_model = random_model.replace(...
    random_clothes = random_clothes.replace(...

    attributes = [...]
Enter fullscreen mode Exit fullscreen mode