33
$\begingroup$

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 want to see the numbers next to the verts

enter image description here

$\endgroup$
1

4 Answers 4

49
$\begingroup$

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.

  1. Start Blender in debug mode, or simply go to Python Console (Shift-F4) and type bpy.app.debug = True
  2. Go to N-panel > Mesh Display
  3. A checkbox Indices will now show
  4. The colors are controlled by the interface theme

There'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.

  1. Run Blender normally
  2. Click Edit > Preferences...
  3. In the Display panel of the Interface tab, tick Developer Extras
    or type bpy.context.preferences.view.show_developer_ui = True into the Python console.
  4. Open the Overlays popover in the 3D View Overlays popover
  5. Look for the label Developer and tick the checkbox Indices

    Developer Overlay Indices

$\endgroup$
8
  • $\begingroup$ CoDEmanX steps work for Blender Version 2.73.a on OS X. !enter image description here $\endgroup$
    – user13466
    Commented Mar 28, 2015 at 23:46
  • $\begingroup$ @CoDEmanX I can't download the visualizer script.... do you know if the address is ok??? thanks $\endgroup$
    – yhoyo
    Commented Mar 29, 2015 at 4:28
  • 2
    $\begingroup$ @Bauxite It moved into the Overlays popover and depends on a different option now (Developer Extras, bpy.context.preferences.view.show_developer_ui). I updated my answer. $\endgroup$
    – CodeManX
    Commented Apr 9, 2020 at 15:46
  • 1
    $\begingroup$ And since, by default, the dark blue indices are so horrible to read on the dark gray background, you may wanna change "Theme > 3D Viewport > Face Angle Text" to a brighter color aswell. $\endgroup$
    – Ray
    Commented Jan 27, 2021 at 13:29
  • 2
    $\begingroup$ @AlexMekx You need to be in Edit Mode of a Mesh to see the option. After enabling it, you need to select something. The selection mode determines whether it displays vertex, edge, face indices, or a combination of them. $\endgroup$
    – CodeManX
    Commented Aug 18, 2022 at 18:36
10
$\begingroup$

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.

enter image description here

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.

$\endgroup$
1
  • 3
    $\begingroup$ Any plans to port this 2.8? The immediate mode is gone, bgl.Color etc. are no longer supported and don't know how to use the new way, using bind buffers and stuff. Also, coloring the text will probably require support in blf, because without immediate you can't set a color just like that before the blf draw call to affect it. $\endgroup$
    – CodeManX
    Commented May 24, 2018 at 12:28
1
$\begingroup$

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!

$\endgroup$
1
  • $\begingroup$ The OP wanted to show the index in the viewport. $\endgroup$ Commented May 8, 2018 at 19:26
0
$\begingroup$

It's under the mesh edit mode icon now (you have to be in edit mode...):

enter image description here

Make sure to enable developer mode:

enter image description here

$\endgroup$

You must log in to answer this question.