random number in a switch
i would like pick a random number from 0 - 3 from a switch please see picture
random number in a switch ?
8660 4 0- gfxfx
- Member
- 91 posts
- Joined: Oct. 2015
- Offline
- sepu
- Member
- 419 posts
- Joined: Feb. 2012
- Online
- gfxfx
- Member
- 91 posts
- Joined: Oct. 2015
- Offline
- tamte
- Member
- 8513 posts
- Joined: July 2007
- Offline
- Callmedude88
- Member
- 1 posts
- Joined: May 2017
- Offline
I'm new to houdini and expressions in general, but found this formula to work for one of my switches…
round(rand($F* 0.1)*3)
… if you have more than 4 switch connection, say you have 15, then you could change the formula to this…
round(rand($F* 0.1)*14)
This expression allows for random whole numbers from 0 to 14. A total of 15.
Cheers?
round(rand($F* 0.1)*3)
… if you have more than 4 switch connection, say you have 15, then you could change the formula to this…
round(rand($F* 0.1)*14)
This expression allows for random whole numbers from 0 to 14. A total of 15.
Cheers?
-
- Quick Links