Search - User list
Full Version: Cannot create a point group from pattern
Root » Houdini Indie and Apprentice » Cannot create a point group from pattern
werwack
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
Anonymous
Maybe if you switch to groupByExpression instead of groupByPattern it will ork better .
werwack
Thank you, that's also what I just discovered ops:

So the current thing is I don't understand exactly what is a pattern.
Is it just a string with numbers and a few special characters to make them interpreted as a range or a set of number?
old_school
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.
werwack
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB