Jump to content

Questions about a 10k Random Characters output setup


Recommended Posts

Hi magicians,

I'm developing a system that needs to output 10.000 different characters.

I will have some different character poses as imputs, as well as some assets (hats, glasses, etc).

I made a quick setup to test it, where I mainly use switchs and expressions:




This kinda works for small amounts, but I need to figure certain things that would love to hear any thoughts on how to achieve them:

1) With my switch/expression setup, I have random outputs, but how can I define that none of them will be equal?

2) How can I set the setup, to be able to export "only 100 over 10.000 of them with hats"

3) How can I avoid (I guess if/else but im not good at vex) for example: If we have a brown hat, don't output a brown background.


Thank you!



Link to comment
Share on other sites

1. If you think about this carefully, random may not be the way to go here. You can use the modulo operator "%" to step increments - such that the last switch in the chain cycles between say, 10 inputs, 1 per frame. The switch before that uses floor() function, cycles only every 10 frames, so that every combination of the last 2 switches is produced uniquely.

switch_input1: $F%10 -> goes 0, 1, 2, ..., 8, 9, 0, ...
switch_input2: floor($F/10) - > goes 0, 0, 0, ..., 0, 0, 1, ...

One way to simplify this idea - if I have 4 switches 0000, each with <=10 inputs, then I can get every unique output by cycling the digits like counting upwards - 0001, 0002, ... 9999.

2. To control this kind of statistical weighting, you will likely already have a "Has hat" toggle parameter. You can use Wedge TOP to batch out the 100 with hats, and the other 9900 without.

3. I'm not sure how to help with this.

Edited by Fenolis
  • Thanks 1
Link to comment
Share on other sites

Hey @Fenolis thanks for the tips!

1. I was doing something similar with the modulo, but started to learn PDG/TOPS and I think it will be much easier!

2. Haven't thought about the "has hat" parameter, that might be handy, I think splitting the TOP in 100 + 9900 is the easiest way to go, thanks!

3. A friend told me about conditioners with id or strings to compare, don't know too much about VEX but will dig around that.

If somebody knows a way to solve point 3 in PDG would love to hear it!




Link to comment
Share on other sites

If you don't want to get into TOPs just for this, you can just use a For Loop. It is possible to vary any incoming parameter from your source geometry with any level of control that you desire.

For very large iterations, you might want to turn that into a Compile Block to boost performance (be warned though, here be dragons...)

In the example I'm posting, I'm varying the bend angle, and the probability of adding a hat to the result, but you can go nuts with literally any parameter on the source geometry.

I have used separate nodes for each variation because I personally like that clarity, but you can just easily have all of them in a single Wrangle.



Edited by eikonoklastes
Link to comment
Share on other sites

Hey @eikonoklastes! Thanks a lot for taking the time to make this file, appreciate it a lot!

I'm downloading now for some studying, interesting to have this for loops option.

I also been learning about TOPs and gotta say I love it! so I have 2 of 3 questions solved, last one I'm trying to figure out

is "avoid black hat with black background", a friend told me about using ids or strings to compare, im not good at vex but will read about,

if any good soul can post a example of this I will be super helpful.

Thank you!

Link to comment
Share on other sites



That could be usefull?

//The match function return 1 if the string attribute match a string, else is 0

int i = match("name", s@group);


After if you could keep thing simple my friend if you start by the choosing the background color, you could define a limited random limited range of color from that, picking the opposite for example (reverse the color)  or at least offset in hue for the Hat and i guess the other pig element too. Excepted if you want a black pib on a black background with glowing eye , that might be the coolest :ph34r:

I might do some NFT one day i have to ask you few things about, look like fun :) and, here's  it might be a good break from film or TV serie work

i did few more research by the way in my spare time, have a look :)





Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts


Link to comment
Share on other sites

Hey buddy! @vinyvince

Thanks for the match function, will give that a go!

Regarding the background color I ended making a if/else on a wrangle and "I think" I got it, gotta test it on the setup xD

Of course! feel free to drop me a line with any questions, this particular project is for a client, but I'll do mine after this, like you, for a break of clients!

All those hard surface experiments on your linked in look AMAZING! already told you, love your progress and all those stuff you are working on! keep going my friend



Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
On 10/18/2021 at 7:23 AM, divisionof8 said:

Are you able to explain how you set this up? I am looking to do something similar using PDG; start with a one character, and export 20 versions, each with a different diffuse texture.

It helps if your textures are ordered numerically.

In TOP (tasks) context, create a topnet and inside it, create a Wedge node. The wedgecount value can be accessed using "@wedgeindex", which you can use in an expression to get it to retrieve a different texture file for each wedge. You can also create wedge attributes and use those instead of @wedgeindex, for more control. You can set the value of these wedge attributes using @wedgeindex, like using modulo(%) to cycle through the same set of values, e.g. @wedgeindex%10 will cycle through 0-9

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...