Attribute Wrangler: how to loop over edge group?
1540
4
0
raincole
Member
692 posts
Joined: 8月 2019
オフライン
2025年3月2日 19:01
Attribute Wrangler can run over Points, Primitives or Vertices:
But where is "Edges"? If I have an edge group, how to run some vex code for each edge in the group?
I know I can use
expandedgegroup()in Detail mode, but it will be single-threaded, without the usual benefit of using a Wrangler, right?
Attachments:
Screenshot 2025-03-03 075907.jpg (39.9 KB)
animatrix_
Member
5048 posts
Joined: 2月 2012
オフライン
2025年3月2日 23:06
Hi,
Edge support in VEX is a long standing RFE
#58641 (11 years old). It goes hand in hand with having edge attributes which would also open up a lot of interesting workflows IMO.
Right now there are a few ways you can do this. One of them is making your own Edge Wrangle but it's quite involved:
Another approach is to utilize half edges in your code rather than edges.
raincole
Member
692 posts
Joined: 8月 2019
オフライン
2025年3月7日 0:11
animatrix_ Edge WrangleThank you for the answer. Is this custom node available anywhere?
Edited by raincole - 2025年3月7日 00:11:55
raincole
Member
692 posts
Joined: 8月 2019
オフライン
2025年3月7日 1:24
As for the hedge solution, this is the best I can come up with:
string egroup = chs ("group" );
int he = vertexhedge (0 , @vtxnum );
int spt = hedge_srcpoint (0 , he );
int dpt = hedge_dstpoint (0 , he );
int ingroup = inedgegroup (0 , egroup , spt , dpt ) & (spt < dpt );
if (ingroup ) {
// Actually process the edge here
}
It's rather hacky but at least it does run over the edges.
animatrix_
Member
5048 posts
Joined: 2月 2012
オフライン
2025年3月7日 2:09
raincole animatrix_ Edge Wrangle Thank you for the answer. Is this custom node available anywhere?Oh yes it's on my patreon. It's a really old node so I have see if it still works in the latest version of Houdini.