Jump to content

Points searching for their nearest available parent, duplicate problem

Recommended Posts

I have 2 sets of points: 'parent' and 'child'. Both have the same number of points. I need each parent point to have a unique child assigned to it - no duplicates.


I need to be able to animate in an active value for the parent points, so that they all become active in 3-4 frames. When a parent point becomes 'active', it needs to search for its nearest available animated point and set that animated point's id number as 'child_id'. An animated point is only 'available' if it doesn't already have a parent point, or in other words: if the child_id is currently unused.


My issue comes from the VOP I've set up within a SOP solver. If there is more than one parent point becoming active on a single frame, I get multiple parent points assigned with the same child point. I need to be able to write to 'child_id' and read from it on the same frame, to make sure that I am not getting multiple parent points with the same child points (leaving some very lonely, parent-less child points :().


Please take a look at my attached file. I've highlighted the important nodes, and the Find Attribute Value VOP in red is where the issue is originating.


Share this post

Link to post
Share on other sites

Hi mark,

I have done similar test long back. There is a target(parent point) and points(child) coming towards the target(both have the same point count). When a child point acquires a target point the other child point doesn't query the same point. have attached the file.runs pretty fast. make sure the active distance is less. Since i have used array it is pretty heavy when there are more points to query at that instant(when active distance is more).Also you can disable attract in sop solver and get the positionId(posid) and use pop attract.




  • Like 1
  • Thanks 1

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