art3mis Posted June 24, 2017 Share Posted June 24, 2017 (edited) 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 operation. Edited June 24, 2017 by art3mis 1 Quote Link to comment Share on other sites More sharing options...
Atom Posted June 24, 2017 Share Posted June 24, 2017 You basically just create a random integer attribute using a wrangle. Then stamp that into the index of a switch. ap_rnd_switch_stamp.hiplc 1 Quote Link to comment Share on other sites More sharing options...
art3mis Posted June 24, 2017 Author Share Posted June 24, 2017 Thanks Atom. Just getting comfortable with copy stamp, now I understand its been deprecated in favor of For Each loops? At least according to Jeff in the recent H16 new geometry workflow webinar. Not intuitive! Quote Link to comment Share on other sites More sharing options...
Atom Posted June 24, 2017 Share Posted June 24, 2017 (edited) Stamping is fine for a few thousand points. After that you may see some lag on an animated multi-stamp geometry generator. But hey, you can always cache that stuff out and regain your speed. I would like to see the above example file implemented in a loop. I'm not quite sure how to do that. Edited June 24, 2017 by Atom Quote Link to comment Share on other sites More sharing options...
Noobini Posted June 24, 2017 Share Posted June 24, 2017 (edited) didn't Jeff provide craploads of sample files to go with the webinar video ? here's one I whipped up...and yes other might have seen this in various forms already...because I'm forcing myself to do this repeatedly so it sinks is... RandomCopyLoop.hipnc (if you check my Opus Grid file...there's random rotate thrown in) Edited June 24, 2017 by Noobini Quote Link to comment Share on other sites More sharing options...
Sepu Posted June 24, 2017 Share Posted June 24, 2017 (edited) Hey Atom like this it would be set up in the new for loop compile blocks... test_rand01.hip Edited June 24, 2017 by Sepu Quote Link to comment Share on other sites More sharing options...
Atom Posted June 24, 2017 Share Posted June 24, 2017 Thanks for the alternate example. It makes sense to me, the loop iteration index takes the place of @ptnum as a unique value for the random seed. I guess I don't understand what the outer compile loop is used for? Quote Link to comment Share on other sites More sharing options...
Sepu Posted June 24, 2017 Share Posted June 24, 2017 You mean the compile blocks? the yellow stuff, the main advantage is that it is multithreaded you can read more herehttp://www.sidefx.com/docs/houdini/model/compile Also Sidefx just release a master class on this topic 1 Quote Link to comment Share on other sites More sharing options...
art3mis Posted June 25, 2017 Author Share Posted June 25, 2017 Very cool. Thanks for these responses. There goes another weekend:) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.