3

I've noticed that after calling bmesh.utils.edge_split the new elements (vert, edge, loops) have -1 indices. They stay -1 even after calling ensure_lookup_table() for all elements.

But, after calling bmesh.utils.edge_split a second time, the elements from the first call now have valid indices, and only the new elements from the second call have -1 indices.

Is there a call I can make to ensure all elements have valid indices when I need them?

I'm currently doing this, but it seems ugly, and it's not obvious to me if this is allowed or not:

for vert_i, vert in enumerate(bm.verts):
    vert.index = vert_i
for edge_i, edge in enumerate(bm.edges):
    edge.index = edge_i
for face_i, face in enumerate(bm.faces):
    face.index = face_i
atb
  • 131
  • 2

0 Answers0