I’m using the following vex to attempt to create a Min max controller with selecting specific polygon sizes and outputting a group from this. But it’s not working and I’m not sure if I’m writing this wrong or not. Thoughts?
float minSize = ch("min_size", 0.1);
float maxSize = ch("max_size", 0.2);
if (@area >= minSize && @area <= maxSize)
{
setprimgroup(geoself(), "selected_polygons", @primnum, 1);
}
else
{
removeprimgroup(geoself(), "selected_polygons", @primnum);
}
vex that selects polygon size
2139 8 0-
- luidox
- Member
- 36 posts
- Joined: Oct. 2018
- Offline
-
- freshbaked
- Member
- 153 posts
- Joined: June 2020
- Offline
luidox
else
{
removeprimgroup(geoself(), "selected_polygons", @primnum);
}
It works fine if you remove those lines. The removeprimgroup function only takes 2 arguments but I'm not sure why you're using that function anyways...
Also wrangles won't show group highlighting unless you type the group name in the Output Selection Group parameter under the bindings tab!
Edited by freshbaked - Sept. 23, 2023 18:21:54
-
- luidox
- Member
- 36 posts
- Joined: Oct. 2018
- Offline
-
- animatrix_
- Member
- 5128 posts
- Joined: Feb. 2012
- Offline
Here is one way:
float minarea = ch("min_area"); float maxarea = ch("max_area"); float area = primintrinsic ( 0, "measuredarea", @primnum ); if ( area >= minarea && area <= maxarea ) i@group_prims = 1;
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- luidox
- Member
- 36 posts
- Joined: Oct. 2018
- Offline
-
- animatrix_
- Member
- 5128 posts
- Joined: Feb. 2012
- Offline
luidox
In this case your using a measure node?
No. I am just checking the area using the primitive intrinsic attribute called "measuredarea".
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- freshbaked
- Member
- 153 posts
- Joined: June 2020
- Offline
-
- luidox
- Member
- 36 posts
- Joined: Oct. 2018
- Offline
-
- freshbaked
- Member
- 153 posts
- Joined: June 2020
- Offline
-
- Quick Links


