Randomly choose between mutliple source objects for copy To operation

   7678   3   1
User Avatar
Member
350 posts
Joined: June 2016
Offline
Not sure how to do this but I need to randomly choose between multiple source objects in a copyTo point SOP.

Imagine a Sphere with Scattered points on the surface.

Now using a copyTo SOp imagine having to copy not just 1 object to these points, but randomly choose between multiple.

ie For 3 objects instead of copying just a green colored grid, randomly choose either a red, green or blur grid for the copyTo points (on the sphere) operation.
User Avatar
Member
65 posts
Joined: Feb. 2013
Online
hey Eco! If there's no specific reason you must use “copy to geometry”, I think you should use “copy stamp” instead.
Check this video:
https://www.sidefx.com/tutorials/copy-stamping-node/ [www.sidefx.com]
the idea is the same but you'll stamp the random value on a switch node in your left branch. The input for the switch node are all the objects you want to scatter.

I hope this can help
User Avatar
Member
350 posts
Joined: June 2016
Offline
Thanks. Getting a handle on copy stamp, but now apparently its being deprecated in favor of for each loops
User Avatar
Member
10 posts
Joined: July 2016
Offline
Would suggest watching the new master class [sidefx.com].

But here's a quick example file for you. Just to note I use the spare input to get the detail. Just good practice with the new compile block added to 16.

Attachments:
rand_copyToPoint.hiplc (60.9 KB)

  • Quick Links