1

Can someone please explain to me how I go about selecting edge loops in BMesh? I'm new to Blender scripting and am venturing into BMesh but I can not figure out how to actual select an edge loop. Let's say I'm starting with an edge. How then do I go about getting and selecting the edge loop that that edge is a part of? Please and thank you!

Zach Eastin
  • 125
  • 6

1 Answers1

3

This is almost a duplicate of this question. Simply add the select statement at the end. I also branched the code sample to go in both directions of the first edge.

e = bm.edges[0]

for loop in e.link_loops:
    if len(loop.vert.link_edges) == 4:
        e.select = True

        while len(loop.vert.link_edges) == 4:
            # jump between BMLoops to the next BMLoop we need
            loop = loop.link_loop_prev.link_loop_radial_prev.link_loop_prev

            # following edge in the edge loop
            e_next = loop.edge
            e_next.select = True
Leander
  • 26,725
  • 2
  • 44
  • 105
  • Awesome, thanks! I saw that one but for some reason I couldn't ever get it to work let alone how it actually works. – Zach Eastin Jun 11 '18 at 01:10