scorpes Posted January 22, 2020 Share Posted January 22, 2020 Hi, I would like to know how I can make variation (different objects) using the copytopoints node and changing point counts. I now use the foreach loop with metadata and I use the iteration value to add randomness to a switch node. Like this tutorial: But when point counts change, this method doesn't work anymore and all objects are constantly changing over time. Any idea how to fix this? copytopoint_var_changingPointcount.hip Quote Link to comment Share on other sites More sharing options...
Atom Posted January 22, 2020 Share Posted January 22, 2020 (edited) That is normal, if you deform or change the surface you are scattering the points onto, it's similar to changing the seed on the scatter. You will get a different result every time the surface changes. Read the help card on the PointDeform node to lock down the point set before you CopyToPoints. There are a lot of example on this forum, try the search bar. Edited January 22, 2020 by Atom Quote Link to comment Share on other sites More sharing options...
scorpes Posted January 22, 2020 Author Share Posted January 22, 2020 But there is not something like make the copytopoint randomizations based on @id, instead of @ptnum? My initial point source is a pop network with changing point counts Quote Link to comment Share on other sites More sharing options...
Jason Posted January 22, 2020 Share Posted January 22, 2020 Look into using the CopyStamp methodology where you can control the variation with a Switch SOP containing the randomization method you choose. You could choose something based on @id, for sure. Quote Link to comment Share on other sites More sharing options...
scorpes Posted January 22, 2020 Author Share Posted January 22, 2020 (edited) CopyStamp is the old method..., not compile-able , there is no way to do this with the new method? Edited January 22, 2020 by scorpes Quote Link to comment Share on other sites More sharing options...
markinglevfx Posted January 22, 2020 Share Posted January 22, 2020 (edited) You can use this code in your switch. Currently you're using the loop iteration in the switch, but the point/loop order changes as new points come in so it's different each frame. By referencing each point's id attribute when selecting the object it instances you can keep them constant throughout. Hope it this makes sense. Adjust the max fit value (currently 1) to account for more instance objects fit01(rand(point("../foreach_begin1/", 0, "id", 0)), 0, 1) Edited January 22, 2020 by markingleukc Quote Link to comment Share on other sites More sharing options...
scorpes Posted January 22, 2020 Author Share Posted January 22, 2020 yes this is what I was looking for, thanks! 1 hour ago, markingleukc said: You can use this code in your switch. Currently you're using the loop iteration in the switch, but the point/loop order changes as new points come in so it's different each frame. By referencing each point's id attribute when selecting the object it instances you can keep them constant throughout. Hope it this makes sense. Adjust the max fit value (currently 1) to account for more instance objects fit01(rand(point("../foreach_begin1/", 0, "id", 0)), 0, 1) Quote Link to comment Share on other sites More sharing options...
anim Posted January 22, 2020 Share Posted January 22, 2020 1 hour ago, scorpes said: CopyStamp is the old method..., not compile-able , there is no way to do this with the new method? whatever Mark said since you are using 17.5 however technically the new method since H18 is using Piece Attribute to copy variants to points and avoiding for loop altogether 1 Quote Link to comment Share on other sites More sharing options...
Iskander Posted January 22, 2020 Share Posted January 22, 2020 2 hours ago, anim said: whatever Mark said since you are using 17.5 however technically the new method since H18 is using Piece Attribute to copy variants to points and avoiding for loop altogether Yep and i think it is even faster than compiled for-loops. Quote Link to comment Share on other sites More sharing options...
Iskander Posted January 22, 2020 Share Posted January 22, 2020 (edited) 4 hours ago, scorpes said: CopyStamp is the old method..., not compile-able , there is no way to do this with the new method? Check this. +now it is rather simple copy2points_newpipeline.hipnc Edited January 22, 2020 by Iskander 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.