Jump to content
scorpes

CopyToPoints variation with changing point count

Recommended Posts

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

 

Share this post


Link to post
Share on other sites

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 by Atom

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

CopyStamp is the old method..., not compile-able , there is no way to do this with the new method?

Edited by scorpes

Share this post


Link to post
Share on other sites

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 by markingleukc

Share this post


Link to post
Share on other sites

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)

 

 

Share this post


Link to post
Share on other sites
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

  • Like 1

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

 

Screenshot at 2020-01-23 01-53-13.png

copy2points_newpipeline.hipnc

Edited by Iskander

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×