Hello,
I created a line and then added a group SOP for the last point of the line.
To isolate this last point, I would like to use an expression like “put the point in the group if the point number plus one is the same as the total number of points in the line”.
I translated that as: $PT + 1 == $NPT
But this seems to select 2 points: 0 and 1, not the last one :cry:
What do I do wrong?
Beside how can I check the value of $NPT?
Thank you
Cannot create a point group from pattern
6274 4 2- werwack
- Member
- 71 posts
- Joined: Oct. 2007
- Offline
- Anonymous
- Member
- 678 posts
- Joined: July 2005
- Offline
- werwack
- Member
- 71 posts
- Joined: Oct. 2007
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
You build up expression patterns with conditionals. For example, if you wanted to select the endpoints of a curve, you could use this:
$PT==0 || $PT==$NPT-1
== means “equal to”
!= means “not equal to”
< means “less than”
> means “greater than”
<= means “less than and equal to”
>= means “greater than and equal to”
|| means “or”
&& means “and”
Other conditional expressions could be:
$PT <=5
$PT > 3
$PT <= 10 && $MY_ATTRIB == 1
$PT < 5 && $MY_ATTRIB == 1 || $PT > 20 && $MY_ATTRIB < 0.001
If you want to process a bunch of curves and grab their endpoints, you can use an Attribute Create SOP and in vertex mode use the local variables for vertices to set the end points to 1 and the interior points to 0 and then use that local variable in the expression condition of a Group SOP.
Hope this helps out.
$PT==0 || $PT==$NPT-1
== means “equal to”
!= means “not equal to”
< means “less than”
> means “greater than”
<= means “less than and equal to”
>= means “greater than and equal to”
|| means “or”
&& means “and”
Other conditional expressions could be:
$PT <=5
$PT > 3
$PT <= 10 && $MY_ATTRIB == 1
$PT < 5 && $MY_ATTRIB == 1 || $PT > 20 && $MY_ATTRIB < 0.001
If you want to process a bunch of curves and grab their endpoints, you can use an Attribute Create SOP and in vertex mode use the local variables for vertices to set the end points to 1 and the interior points to 0 and then use that local variable in the expression condition of a Group SOP.
Hope this helps out.
There's at least one school like the old school!
- werwack
- Member
- 71 posts
- Joined: Oct. 2007
- Offline
You build up expression patterns with conditionals.
This is confusing for me in the way that the Group SOP has a dropdown list allowing you to enter either a “pattern” or an “expression”.
I kind of understand the expressions so far.
The “pattern” seem to be, as I mentioned, a way to create a set of number, is that it?
You cannot put expression strings in it, is that it?
Thank you,
Werwack
Video Game Graphics TD
-
- Quick Links