Deleting first and last point over for each primitive

   271   3   0
User Avatar
Member
1 posts
Joined: April 2019
Offline
Hi ,
I'm doing an animation with vellum where points of hairs are being deleted when entering a bounding obj (got this working)
But I would like to add a condition where only the first and last point can be deleted, so no points in the middle can be deleted first.

I thought of doing that by grouping the first and last point, but I can't get it to work for each hair.

Any help or ways to do that would be very helpful , thanks

Basically having the red points in a group , that will be deleted if they go inside a bounding box, and if they get deleted the green points become the first or last point, inside a dop network.

Attachments:
Points_tobe_deleted.png (463.6 KB)

User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
You can isolate/group/set attributes for the first and last points of the primitive by
using the primpoints() function.

It returns an array of point numbers that belong that prim, in the same order as they are on the primitive.
So you can select by index the first element and last element of the arrays.
Edited by BabaJ - April 18, 2024 12:03:48
User Avatar
Member
696 posts
Joined: March 2009
Offline
Use the group expression SOP on points and pick the "point valence" preset from the dropdown.
A value of 1 should be enough to pick up the extremities of each primitive.

Cheers,

Attachments:
rVXGnzu5rj.png (38.1 KB)

Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
4517 posts
Joined: Feb. 2012
Offline
Hi,

Here is one way:

if ( neighbourcount ( 0, @ptnum ) == 1 )
    i@group_endpts = 1;

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
  • Quick Links