Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

March 26, 2014

Note to self BMesh

small note to self: useful snippets for debugging mesh editing tools. and then

Removing Edges

From my understanding of this (may be wrong, still experimenting): say I have edges with indices [0,1,2,3,4,5,6,7] and I delete an edge with index 4.
  • I won't get [0,1,2,3, 5,6,7]
  • But will become [0,1,2,3,4,5,6].
    Don't assume that there's a direct remap happening, like: (5->4, 6->5, 7->6). Indices may be jumbled up.
  • In the case of removing multiple edges from a list, ordering your edge indices from highest to lowest won't guarantee that you are deleting the right edge.

Using bmesh.ops.remove()

As per this post on StackExchange. Using any other method has given me unexpected results. So whether you need to remove 1 or multiple edges, the bmesh.ops.remove method will happily take a list of edges and remove them without the headache of bookkeeping or tagging.