rand() help
4478 5 0- joeldeehr
- Member
- 4 posts
- Joined: Dec. 2009
- Offline
Hi, this should be easy for most of you out there. I am using geometry to scatter popcorn kernels (I have 3) around a model of a “pile.” Anyway, I figured out how to use the scatter SOP and copy SOP to aid me in this, and also Im aware of the “switch” SOP to switch between the 3 kernels. Where I need help is: I am assuming I need to throw in the rand() expression into the input of the Switch node to vary the popcorn kernels all over the model. rand($F) will not work because this is just going to be a stationary pile of popcorn. What do I put inside of the parentheses to get that randomization? Or am I needing to throw in another node somewhere? I feel like this should be really easy. Thanks!
Joel
- Soothsayer
- Member
- 862 posts
- Joined: Oct. 2008
- Offline
- tamte
- Member
- 8602 posts
- Joined: July 2007
- Offline
or you can simplify that expression to
floor(stamp(“../copy1”, “rrand”, 0)*3)
supposing that the name of the copy SOP is “copy1” and that you have copy stamping enabled on it with rrand variable set to rand($PT) according to Soothsayer's post
but maybe this video can help you understand what copy stamping is and how it can be used http://www.sidefx.com/index.php?option=com_content&task=view&id=881&Itemid=132 [sidefx.com]
floor(stamp(“../copy1”, “rrand”, 0)*3)
supposing that the name of the copy SOP is “copy1” and that you have copy stamping enabled on it with rrand variable set to rand($PT) according to Soothsayer's post
but maybe this video can help you understand what copy stamping is and how it can be used http://www.sidefx.com/index.php?option=com_content&task=view&id=881&Itemid=132 [sidefx.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
Maybe an expression like stamp(“../copy1' , ”myrand“ , 3) into my switch sop , then in the copy sop I would add a stamp expression using floor. So for the variable I would use something like floor( rand($PT) * opninputs(”../switch") ) . This should assign a random popcorm kernal to each point as you have 0 , 1 , 2 inputs into the switch SOP.
rob
rob
Gone fishing
- Soothsayer
- Member
- 862 posts
- Joined: Oct. 2008
- Offline
- joeldeehr
- Member
- 4 posts
- Joined: Dec. 2009
- Offline
-
- Quick Links