In the script I’m writing, I want to get the coordinates of each vertex in each of several edge loops which the script will find (i.e. the edge loops are not manually selected). I am proceeding by getting Python to discover which edges I am interested in and make the selection for me. The script works fine as far as finding a group of single edges which are the starts of the edge loops. It successfully identifies which edges I want to as the beginnings of the edge loops.
The trouble is in trying to select the single edges so I can call bpy.ops.mesh.loop_multi_select(ring=False) to select the rest of the edge loop. The functions I know about require that I toggle into Edit Mode, which introduces issues that I’m not entirely familiar with. Here’s the code snippet I would like to use:
bpy.ops.object.mode_set(mode='EDIT')
for edge in edgeList:
bpy.ops.mesh.select_all(action='DESELECT')
edge.select=True
bpy.ops.mesh.loop_multi_select(ring=False)
bpy.ops.object.mode_set(mode='OBJECT')
Going into this for loop in my test file, edgeList has three parallel edges in it. After running the script, all three edges in the list are selected and any edges I had manually selected remain in the selection. The edge loops are not selected.
So what I see is that select_all is not clearing the selection and loop_multi_select is not adding to the selection.
Is there another way that I can take my list of single edges and select an edge loop from each one?