get every -X points in a group (VEX)

   2965   3   0
User Avatar
Member
1177 posts
Joined: April 2017
Offline
Hi! I'm new to VEX.

I would like to learn how to get all the points in negative X in a group. Is this a “if” statement thingy?

Thanks.

-Olivier
User Avatar
Member
2164 posts
Joined: Sept. 2015
Offline
if(@P.x < 0)
{
setpointgroup(geoself(), "Points_Negative", @ptnum, 1, "set") ;
}
Edited by BabaJ - Feb. 26, 2018 20:54:55
User Avatar
Member
9384 posts
Joined: July 2007
Offline
if you want to run any operator that accepts point groups only on certain group and only if the point in the group is in negative x then you can put this in the Group field and set Group Type to Point
(assuming your group name is mygroup)

mygroup ^@P.x>=0

which reads, execute for all points in the mygroup group except for points whose @P.x>=0

if you just want a group with all negative points then either:
Group Expression SOP over Points:
@P.x<0
OR
PointWrangle SOP:
@group_mygroup = @P.x<0;
Edited by tamte - Feb. 26, 2018 20:59:41
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1177 posts
Joined: April 2017
Offline
Ok, that's clearer now. Thanks for all the examples (there's too many!)

I'll check it out.

Thanks!

-Olivier
  • Quick Links