7
$\begingroup$

How can I get a list of vertices that share edge with a given vertex over script? I need this to work in edit mode.

$\endgroup$
10
$\begingroup$

Yes, this is possible using BMEdge.other_vert

This script runs in edit-mode.

import bpy
import bmesh

obj = bpy.context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)

for v in bm.verts:
    for e in v.link_edges:
        v_other = e.other_vert(v)

        # print some info
        print("%d -> %d via edge %d" % (v.index, v_other.index, e.index))
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.