Coder Social home page Coder Social logo

Comments (4)

sk33z3r avatar sk33z3r commented on July 2, 2024

Seems like it might be breaking down somewhere around these lines
https://github.com/sk33z3r/LooPyGen/blob/main/generator/generate.py#L166-L169

But I don't see how exactly. Otherwise I don't really see how it's mis-matching in the code unless I have something set wrong in traits. Just for posterity, here's the whole file. I'm baffled why layer00-layer03 works, but layer04 fails.

## Give the collection a name
COLLECTION_NAME="Tropical JEFF"

## Layers dictionary
layers = [
    {   # Background color
        "layer_name": "Background color",
        "rgba": {
            "Red":    (192,  54,  54, 255),
            "Green":  ( 54, 192,  54, 255),
            "Blue":   ( 54,  54, 192, 255),
            "None":   (  0,   0,   0,   0),
            "Black":  (  0,   0,   0, 255),
            "White":  (255, 255, 255, 255)
        },
        "weights": [
            2,
            2,
            2,
            1,
            3,
            4
        ],
        "size": (4820, 4873)  # Adjust to the size of your images
    },
    {   # layer01
        "layer_name": "Body",
        "filenames": {
            "JEFF": "01-base.png"
        },
        "weights": [
            100
        ]
    },
    {   # layer02
        "layer_name": "Top",
        "filenames": {
            "Purple Bra": "05-shirt.png",
            "Green Bra": "06-shirt.png",
            "Peach Bra": "07-shirt.png",
            "Yellow Bra": "08-shirt.png",
            "Red Bra": "09-shirt.png",
            "Pink Bra": "10-shirt.png",
            "Pink Shirt": "11-shirt.png",
            "Green Shirt": "12-shirt.png",
            "Blue Shirt": "13-shirt.png",
            "Purple Shirt": "14-shirt.png",
            "Orange Shirt": "15-shirt.png"
        },
        "weights": [
            1,
            2,
            4,
            3,
            2,
            2,
            4,
            3,
            1,
            1,
            2
        ]
    },
    {   # layer03
        "layer_name": "Pants",
        "filenames": {
            "Blue Swimpants": "swimpants/01-swimpant.png",
            "Green Speedo": "swimpants/02-swimpant.png",
            "Pink Speedo": "swimpants/03-swimpant.png",
            "Orange Speedo": "swimpants/04-swimpant.png",
            "Red Speedo": "swimpants/05-swimpant.png",
            "Blue Speedo": "swimpants/06-swimpant.png",
            "Green Swimpants": "swimpants/07-swimpant.png",
            "Yellow Swimpants": "swimpants/08-swimpant.png",
            "Orange Swimpants": "swimpants/09-swimpant.png",
            "Red Swimpants": "swimpants/10-swimpant.png",
            "Hula Skirt 01": "hula-skirt/01-skirt.png",
            "Hula Skirt 02": "hula-skirt/02-skirt.png",
            "Hula Skirt 03": "hula-skirt/03-skirt.png",
            "Hula Skirt 04": "hula-skirt/04-skirt.png",
            "Hula Skirt 05": "hula-skirt/05-skirt.png",
            "Hula Skirt 06": "hula-skirt/06-skirt.png",
            "Hula Skirt 07": "hula-skirt/07-skirt.png",
            "Hula Skirt 08": "hula-skirt/08-skirt.png",
            "Hula Skirt 09": "hula-skirt/09-skirt.png",
            "Hula Skirt 10": "hula-skirt/10-skirt.png",
            "Hula Skirt 11": "hula-skirt/11-skirt.png",
            "Hula Skirt 12": "hula-skirt/12-skirt.png",
            "Hula Skirt 13": "hula-skirt/13-skirt.png",
            "Hula Skirt 14": "hula-skirt/14-skirt.png",
            "Hula Skirt 15": "hula-skirt/15-skirt.png",
            "Hula Skirt 16": "hula-skirt/16-skirt.png",
            "Green Pants": "pants/01-pants.png",
            "Teal Pants": "pants/02-pants.png",
            "Purple Pants": "pants/03-pants.png",
            "Red Pants": "pants/04-pants.png",
            "Yellow Pants": "pants/05-pants.png",
            "Orange Pants": "pants/06-pants.png",
            "Blue Pants": "pants/07-pants.png"
        },
        "weights": [
            25,
            15,
            15,
            15,
            15,
            15,
            25,
            25,
            25,
            25,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            10,
            40,
            40,
            40,
            40,
            40,
            40,
            40
        ]
    },
    {   # layer04
        "layer_name": "Belt",
        "filenames": {
            "Black Belt": "01-belt.png",
            "Purple Belt": "02-belt.png",
            "Red Belt": "03-belt.png",
            "Green Belt": "04-belt.png",
            "Yellow Belt": "05-belt.png",
            "Purple Belt": "06-belt.png"
        },
        "weights": [
            1,
            2,
            4,
            3,
            2,
            2
        ]
    }
]

def get_variation_cnt():
    cnt = 1
    for l in layers:
        cnt *= len(l["weights"])
    return cnt

from loopygen.

sk33z3r avatar sk33z3r commented on July 2, 2024

I am testing a fix for #25 and noticed that even when I take out layer00 (Background Color), the weights still seem to be mismatched if I have layer04 in there. So it doesn't seem to have anything to do with the actual amount of layers. Still thinking there's an issue I am overlooking in my layer04 syntax, though.

from loopygen.

Montspy avatar Montspy commented on July 2, 2024

Dictionary keys need to be unique. You have 2 "Purple belts" in your layer04 definition

        "filenames": {
            "Black Belt": "01-belt.png",
            "Purple Belt": "02-belt.png",
            "Red Belt": "03-belt.png",
            "Green Belt": "04-belt.png",
            "Yellow Belt": "05-belt.png",
            "Purple Belt": "06-belt.png"
        },

from loopygen.

sk33z3r avatar sk33z3r commented on July 2, 2024

Some times a second pair of eyes is all you need, closing

from loopygen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.