メッシュの中に、面を持たない頂点や辺が存在していると、他のデータ形式にエクスポートする際にトラブルの元になります。このような頂点は残さないほうがいいということで、これを選択状態にするスクリプトを作ってみました。あとはXキーで削除するだけです。
import bpyこのスクリプトは、メッシュオブジェクトを編集モードにして実行してください。
import bmesh
bpy.context.tool_settings.mesh_select_mode = [True, False, False]
bpy.ops.mesh.select_all(action = 'DESELECT')
obj = bpy.context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)
loops = set(y.index for x in bm.faces for y in x.verts)
non_faces = [x.index for x in bm.verts if x.index not in loops]
for i in non_faces:
bm.verts[i].select = True
bmesh.update_edit_mesh(me, True)