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
2137 8 0-
- luidox
- Member
- 36 posts
- Joined: 10月 2018
- オフライン
-
- freshbaked
- Member
- 153 posts
- Joined: 6月 2020
- オフライン
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 - 2023年9月23日 18:21:54
-
- luidox
- Member
- 36 posts
- Joined: 10月 2018
- オフライン
-
- animatrix_
- Member
- 5125 posts
- Joined: 2月 2012
- オフライン
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: 10月 2018
- オフライン
-
- animatrix_
- Member
- 5125 posts
- Joined: 2月 2012
- オフライン
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: 6月 2020
- オフライン
-
- luidox
- Member
- 36 posts
- Joined: 10月 2018
- オフライン
-
- freshbaked
- Member
- 153 posts
- Joined: 6月 2020
- オフライン
-
- Quick Links


