I have a POP simulation and I'm trying to write a code in VEX to delete all those particles (From the beginning) that between frame 1-100 have at least once been below the ground (zero).
Every particle has an @id, so I was thinking to group them by @id and then blast them. The problem is that the codes I've been trying didn't work.
What's the best way to do it? Any help would be much appreaciated.
[VEX] Group/delete particles by @id
5931 4 0-
- AlbusNolente
- Member
- 19 posts
- Joined: June 2019
- Offline
-
- animatrix_
- Member
- 5100 posts
- Joined: Feb. 2012
- Offline
Hi,
You have to do it in a Solver SOP. You can write something like this in Attribute Wrangle (Run Over: Points):
You have to do it in a Solver SOP. You can write something like this in Attribute Wrangle (Run Over: Points):
if ( @P.y < 0 ) removepoint ( 0, @ptnum );
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- AlbusNolente
- Member
- 19 posts
- Joined: June 2019
- Offline
animatrix_
Hi,
You have to do it in a Solver SOP. You can write something like this in Attribute Wrangle (Run Over: Points):if ( @P.y < 0 ) removepoint ( 0, @ptnum );
Yes this code deletes the particles just when they go below the ground, but in some way I need to store the id of those and completely delete them from frame 1.
-
- jerry7
- Member
- 680 posts
- Joined: Nov. 2013
- Offline
-
- animatrix_
- Member
- 5100 posts
- Joined: Feb. 2012
- Offline
If you store them you still have to use a Solver SOP to accumulate the values. So you can store an attribute for deletion like this:
TimeShift to the last frame and Attribute Copy delete attribute to the time dependent branch.
Then blast them using:
@delete==1
in the Group field, and Group Type set to Points.
if ( @P.y < 0 ) i@delete = 1;
TimeShift to the last frame and Attribute Copy delete attribute to the time dependent branch.
Then blast them using:
@delete==1
in the Group field, and Group Type set to Points.
Edited by animatrix_ - Jan. 6, 2021 07:59:32
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- Quick Links


