Weighted Average Switch

   1053   2   2
User Avatar
Member
18 posts
Joined: Sept. 2020
Offline
Greetings All,

I am trying to make a weighted average switch. Here is the premise:

Let's say I have 4 objects and each has a "weight"

A = 80% chance of coming up
B = 10% chance of coming up
C = 5% chance of coming up
D = 5% chance of coming up

I was thinking about making a prim attr that will hold the weight of each object. I could merge all the geometry together and then delete the prims that are not picked. I think I would do this in a wrangle but I can't for the life of me figure out the algorithm to set this up.

any help would be appreciated.

Cheers!,
B
User Avatar
Member
3 posts
Joined: Oct. 2014
Offline
If you're trying to instance something, it should be processed before copying it.

This is what I would do.

And you can check check my scene file.
Edited by TorrFox - Feb. 15, 2022 23:51:52

Attachments:
weight_switch.jpg (831.7 KB)
weight_switch.hip (130.7 KB)

User Avatar
Member
7810 posts
Joined: Sept. 2011
Offline
bryanebentleycgs
Greetings All,

I am trying to make a weighted average switch. Here is the premise:

Let's say I have 4 objects and each has a "weight"

A = 80% chance of coming up
B = 10% chance of coming up
C = 5% chance of coming up
D = 5% chance of coming up

I was thinking about making a prim attr that will hold the weight of each object. I could merge all the geometry together and then delete the prims that are not picked. I think I would do this in a wrangle but I can't for the life of me figure out the algorithm to set this up.

any help would be appreciated.

Cheers!,
B

Check out Attribute from Pieces, it does exactly that.
  • Quick Links