I have the following script (doesn't work) to try to select the next connected vertex (of the current object) in a mesh. Would appreciate some help. thanks
# seems like I need to toggle this to sync script to view. Please help
# if there is a better way!
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.mode_set(mode='EDIT')
count = len(bpy.context.scene.objects.active.data.vertices)
try:
active = [e.index for e in bpy.context.scene.objects.active.data.vertices if e.select][0]
except IndexError:
active = 0
active = (active+1) % count
for idx, e in enumerate(bpy.context.scene.objects.active.data.vertices):
if idx==active:
e.select = True
else:
e.select = False
TextEditor -> Templates -> Python -> BMesh Simple EditMode
. $\endgroup$