Random Copy ?

   3806   2   1
User Avatar
Member
113 posts
Joined: July 2005
Offline
Hi Everybody,


I was wondering if someone knows how to do this :

Let's say I have a surface and 2 primitives ( a box and a sphere for example), how would you “randomly” copy spheres and boxes onto the surface ? I mean with a ramdom percentage of sphere amount and boxes amount .


thanks
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Copy Stamping is your answer.

Try this.

In your Copy SOP, go to the stamp folder, create a new Var 1 called choice and Param 1 to rand($PT).
In the Switch SOP's Select Input parameter, put param(“choice”, 0) where $PT is the point number to be processed on the template grid and 0 is the default if you aren't stamping.

Now back to the Copy SOP's stamp folder and turn on Stamp Inputs.

Now you should see random spheres and cubes. To get a different solution, just add a different seed value in your rand() function like rand($PT + 1.9876) where 1.9876 can be any number, big or small to get different solutions. If you want a different solution per frame, use $F as your seed like rand($PT + $F + 1.9876).
There's at least one school like the old school!
User Avatar
Member
113 posts
Joined: July 2005
Offline
thanks for the quick answer !
  • Quick Links