Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seed + config #54

Open
peteashworth opened this issue Feb 14, 2024 · 8 comments
Open

Seed + config #54

peteashworth opened this issue Feb 14, 2024 · 8 comments

Comments

@peteashworth
Copy link

Is there currently a solution to pass in sex + seed. I want to create an avatar off a unique seed but I know the sex. That way the avatar will be sex proper (as I have that info) but then use unique id to generate the other appearance props.

@jzombie
Copy link

jzombie commented Feb 14, 2024

@peteashworth I'm not the maintainer but you should be able to generate a config w/ only the details that you know, and the rest should be randomized.

const config = genConfig({ sex: "man", hairStyle: "mohawk" })

Edit: I missed the point about the seed, though. My apologies.

@jzombie
Copy link

jzombie commented Feb 14, 2024

If I'm not mistaken you should be able to do something like this:

const initialConfig = genConfig("[email protected]") 
const config = genConfig({ ...initialConfig, sex: "woman" }) 

@peteashworth
Copy link
Author

Thank you @jzombie ; that worked perfectly.

@peteashworth
Copy link
Author

Almost; ran it through some tests and found out there is more to selecting the sex as it drives some of the other styling props such as hair style. Which is the need to be able to set some of the props before generating the seed. Short term; ill manually adjust but just a feature idea.

    "sex": "man",
    "faceColor": "#AC6651",
    "earSize": "big",
    "eyeStyle": "smile",
    "noseStyle": "round",
    "mouthStyle": "peace",
    "shirtStyle": "polo",
    "glassesStyle": "none",
    "hairColor": "#F48150",
    "hairStyle": "womanShort",
    "hatStyle": "none",
    "hatColor": "#fff",
    "eyeBrowStyle": "upWoman",
    "shirtColor": "#F4D150",
    "bgColor": "#FC909F"
}```

@wwayne
Copy link
Contributor

wwayne commented Feb 15, 2024

Thank you @jzombie and @peteashworth
I agree with that, I actually noticed this issue after viewed some use cases. Usually they only have the user's email so I didn't know how to handle such case, let me think more about it and let this issue keep opened at the moment.

@arnavvsinghal
Copy link

Almost; ran it through some tests and found out there is more to selecting the sex as it drives some of the other styling props such as hair style. Which is the need to be able to set some of the props before generating the seed. Short term; ill manually adjust but just a feature idea.

    "sex": "man",
    "faceColor": "#AC6651",
    "earSize": "big",
    "eyeStyle": "smile",
    "noseStyle": "round",
    "mouthStyle": "peace",
    "shirtStyle": "polo",
    "glassesStyle": "none",
    "hairColor": "#F48150",
    "hairStyle": "womanShort",
    "hatStyle": "none",
    "hatColor": "#fff",
    "eyeBrowStyle": "upWoman",
    "shirtColor": "#F4D150",
    "bgColor": "#FC909F"
}```

Can you drop in your manual config for female + seed?

@swapnil-sudhir
Copy link

quick question, can we make an avatar config save in the database for us to keep that for a user ?

@wwayne
Copy link
Contributor

wwayne commented Mar 8, 2024

@swapnil-sudhir Yes the config object returned by getConfig can be saved to a database and retrieved later to be passed to the Avatar component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants