Selecting the last point of a curve in H16

   16616   9   4
User Avatar
Member
80 posts
Joined: Dec. 2013
Offline
Hello,

There was a very handy $N expression that selected the last point of a curve when put in a group sop.

I tried @numpt - 1 in an GroupExpression sop without success. How can I this in h16 ?

Many thanx.
User Avatar
Member
2537 posts
Joined: June 2008
Offline
That is weird, it is like the Pattern field no longer exists in the Group node. Why change something that worked just fine..?

You can drop down a Delete and your expression works in the Pattern field. Just activate Delete-Non-Selected and you will get your single end point.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
80 posts
Joined: Dec. 2013
Offline
Yes that's what I ended up doing, thanx a lot.
User Avatar
Member
80 posts
Joined: Dec. 2013
Offline
oops sorry,

@ptnum == `npoints(0)-1`

works in the expression group.
User Avatar
Member
605 posts
Joined: July 2013
Offline
Because I believe they wanted to lower the barrier of proceduralism in Houdini for new comers.

One should be able to select the 1st/last member of a list without having to learn HScript/Vex beforehand.

So, they introduced the Group by Range node, set the Method to ‘Relative to Start/End’, check the ‘Invert Range’ checkbox and then increase the Start/End value sliders to your liking.

Now this style of Grouping is more accessible to a wider range of Houdini users.

I like this direction of bringing Houdini out of the TD spectrum and into the range of the average Generalist.
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
80 posts
Joined: Dec. 2013
Offline
Thanx Daryl, got it.
User Avatar
Member
517 posts
Joined: Dec. 2013
Offline
Could you use this node?
http://www.sidefx.com/docs/houdini/nodes/sop/groupexpression [sidefx.com]
User Avatar
Member
80 posts
Joined: Dec. 2013
Offline
Yes that's what I did with this expression : @ptnum == `npoints(0)-1`

Thx
User Avatar
Member
9 posts
Joined: Nov. 2011
Offline
Pasto
Yes that's what I did with this expression : @ptnum == `npoints(0)-1`

Thx

Is there a difference between using
@ptnum == `npoints(0)-1`
and
@ptnum == @numpt-1
?

They both do the same thing when placed in a groupexpression sop, I just want to make sure there is a reason for one or the other.
User Avatar
Member
8558 posts
Joined: July 2007
Offline
kennydietrich
They both do the same thing when placed in a groupexpression sop, I just want to make sure there is a reason for one or the other.
@ptnum == @numpt-1
is VEX code and it'd be prefered

@ptnum == `npoints(0)-1` 
evaluates content of `` as HScript expression and injects resulting number into VEX code before compiling, so can't be animated and therefore I'd not advise using it instead of native VEX approach


if you want something that selects last point on all input curves instead of just last point of the input geo, you can do this
vertexprimindex(0, @vtxnum) == primvertexcount(0, @primnum) - 1
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links