Jump to content

CopyToPoints variation with changing point count


scorpes

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

 

Link to comment
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
Link to comment
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
Link to comment
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)

 

 

Link to comment
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
Link to comment
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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...