import bpy, bmesh
mesh = bpy.context.edit_object.data bm = bmesh.from_edit_mesh(mesh) edges1 = set(bm.edges[:]) print(edges1) print("") cut_layer = bm.edges.layers.int.new('cut') edges2 = set(bm.edges[:]) print(edges1) print("") print(edges2) print("") print(edges1 == edges2)
The second instance of print(edges1) outputs a load of dead BMEdges.
I've just run into this problem and it would have been very helpful if this was mentioned somewhere in the documenatation, under the new() method in BMLayerCollection.
You get a very non-descript error if you try and work on the dead geometry, it took me a while to work it out.