Put last point into group

   10309   2   1
User Avatar
Member
41 posts
Joined: July 2014
Offline
I tried to use the $N variable in the Group Create node (in Base Group section) to put the last point of a curve into a group but it seems to be ignored. Am I doing something wrong?
User Avatar
Staff
6205 posts
Joined: July 2005
Offline
$N is a local variable of the old, 15.5 and earlier, Group SOP. The new Group Create does not have local variables, so doesn't have $N.

The easiest way to select the last point is to use a Group By Range. It defaults to “Relative to Start and End”, so set the Start/End to 0 and 1. This will then group all but the last point.

In recent 16 builds there is a “Invert Range” option you can then hit to select just the last point. If you don't have this option yet, you can use a Group Combine afterwards to invert the group.

Alternatively, if you want $N itself, for point groups it is the same as

`npoints(0)-1`

(Note the use of backticks to enter expression mode) For primitive groups, use nprims instead.
User Avatar
Member
41 posts
Joined: July 2014
Offline
Great response. Works flawlessly. Thank you.
  • Quick Links