Hello,
How can I randomly select a bunch of edges?
I've seen a few scripts that can easily randomly select points or primitives, but nothing for edges.
I thought I might start with a group by expression, but that won't allow me to select edges as a starting point.
Maybe something more along the lines of first starting with a full selection group of edges, then using that group, deselect a certain percentage?
Extra credit if I can create a slider to select a percentage of edges!
File attached as a starting point, but there really isn't anything there I've been able to achieve
Randomly Group 50% Of All Edges [Solved]
2378 4 1- GlennimusPrime
- Member
- 78 posts
- Joined: June 2019
- Offline
- vusta
- Member
- 555 posts
- Joined: Feb. 2017
- Offline
sooooooooooooooooooooooo close !!!
if only someone can deliver the Fatality move:
- Remove new points, WITHOUT destroying the edge selection.
C'mon…some VEX guru can do it.
Aside: you'd think selecting new points is damn easy…just get ones with 2 neighbours…but it doesn't work…WTF??? ie. it says the corner points have 2 neighbours !!! HUH ???
if only someone can deliver the Fatality move:
- Remove new points, WITHOUT destroying the edge selection.
C'mon…some VEX guru can do it.
Aside: you'd think selecting new points is damn easy…just get ones with 2 neighbours…but it doesn't work…WTF??? ie. it says the corner points have 2 neighbours !!! HUH ???
Edited by vusta - March 26, 2020 02:52:44
- tamte
- Member
- 8513 posts
- Joined: July 2007
- Offline
int seed = chi("seed"); float chance = chf("chance"); string grp = chs("out_group"); int hstart = primhedge(0, @primnum); int h = hstart; do { int isprimary = hedge_isprimary(0, h); if (isprimary) { int select = rand(h, seed) < chance; if (select) setedgegroup(0, grp, hedge_srcpoint(0, h), hedge_dstpoint(0, h), 1) ; } h = hedge_next(0, h); } while (h != hstart && h != -1);
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- GlennimusPrime
- Member
- 78 posts
- Joined: June 2019
- Offline
- zengchen
- Member
- 77 posts
- Joined: Feb. 2017
- Offline
-
- Quick Links