I am try to do something based on the ID of a vertices. I want blender to show me the vertices ID. How can I have blender show me the ID in the viewport? I do not see an option in the Mesh Display tab.


I am try to do something based on the ID of a vertices. I want blender to show me the vertices ID. How can I have blender show me the ID in the viewport? I do not see an option in the Mesh Display tab.


There's a built-in feature to show mesh element indices, but the option isn't shown in the user interface by default.
Blender 2.7 and older:
The option only shows if the debug mode is enabled.
bpy.app.debug = TrueThere's also an updated version of the Index Visulizer script:
space_view3d_index_visualiser_bmesh.py
Blender 2.8:
It only shows if the developer UI option is turned on.
bpy.context.preferences.view.show_developer_ui = True into the Python console.
Look for the label Developer and tick the checkbox Indices
bpy.context.preferences.view.show_developer_ui). I updated my answer.
– CodeManX
Apr 09 '20 at 15:46
I made a usability modification to the script offered by @CoDEmanX, a while back, because it can be a pain to get the theme colours to play nice enough to let me read the indices. Hence I added a polygon background.

script available from: https://gist.github.com/zeffii/9451340
ideally the bpy.app.debug = True would also include some background for the numbers, as is the case with Ruler/Protractor feature.
On printing one vertex the index comes as a property. So you can utilize that to refer a vertex as well. You can record their indexes while making the vertices.
m=bmesh.from_edit_mesh(bpy.context.object.data)
vertices=[] #include vertices here
m.verts.new(vertices)
indexes=[]
indexes.append( (int)((str)(m.verts[i])[( (str)(m.verts[i]).find('index=') )+2:-1]) for i in range(len(vertices)))
Hope that solves the problem!