Jump to content
Krion

POP WRANGLE - Kill others by current @dead / Stable by particle-id

Recommended Posts

Let me explain what I am trying to do: I make connections, and keep track on the ‘target points’ which from which other points connections were made and how many. (with two attributes: i[]@isTarget_ptID_Array, and i@isTargetOf_counter)
thus far I got a fairly stable connection ‘by id’, but only when particles die some unwanted behaviour is happening and points will snap to the origin. 


I tried to resolve this by trying to kill all connected points when a point dies (by setting the attribute of these connected points to @dead=1 when the current pt is dead, or going to die, before the ‘reaping of the particles’)
But that doesn’t seem to work (or at least in the way I tried). Why does the id 45 not die along when id 20 dies in these gifs? 45 is in the array of the 20, right?


thanks for any help,
 

kill simultaneously.hipnc

freeflow_displayOfProblem.thumb.gif.8481ee37aa2783a1b3c74684a263057c.gif

compare_by_frame.thumb.gif.a491a3c2bcb2992fc1785cb74c4b559d.gif

 

Share this post


Link to post
Share on other sites
Posted (edited)

probably because your 20 died as a result of being marked dead from the list of another id

imagine your POPwrangle is run once over all points in the timestep, before the wrangle you have among others 3 points (your frame 354)

id 15, tgtArray [20], dead 1

id 20, tgtArray [45, 3], dead 0

id 45, tgtArray [ 32 ], dead 0

you run your wrangle over them then point with id 15 sice dying will mark dead it's target prim and also target array ids [20], at the same time in parallel particle with id 20 cause not marked dead yet on input will not trigger it's target array [45,3], so the result will be 

id 15, tgtArray [20], dead 1

id 20, tgtArray [45, 3], dead 1

id 45, tgtArray [ 32 ], dead 0

Edited by anim
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks anim, that’s sobering.

Got a quick and dirty fix now by just point-wrangling this after the connections were made:

if(@P == {0,0,0}){
    removeprim(0,i@primnum,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

×