2

I have created a cuboid room in blender using python and it has 289 faces as shown in the stats (in the image). How can I find which polygon number a particular face is ?

For example, If I print the output of the number of polygons by

Code snippet: 
mesh = ob.data
face_list = [face for face in mesh.polygons]
print('Face list: ', face_list)

Output: bpy.data.meshes['new_mesh.001'].polygons[0], bpy.data.meshes['new_mesh.001'].polygons[1] ... bpy.data.meshes['new_mesh.001'].polygons[288]

I want to know which face belong to which polygon number. Is there a way to find this ?

enter image description here

Sarah L
  • 87
  • 5

2 Answers2

6

To use indices (small blue number) you have to enable the Interface > Display > [X] Developer Extras in the User Preferences dialog to see this option. enter image description here

Or use MeasureIt Tools (build-in) enter image description here

relaxed
  • 2,267
  • 6
  • 15
  • 4
    You should mention in your answer that you have to enable the Interface > Display > [X] Developer Extras in the User Preferences dialog to see this option. – Blunder Oct 31 '21 at 11:33
  • Thanks for the advice. I edited the answer – relaxed Dec 14 '21 at 09:48
1

For Python: The index is stored in face.index.

Related question: How can I check face selection in edit mode

To print the indexes of all selected faces in Edit mode:

import bpy
import bmesh

context = bpy.context ob = context.edit_object me = ob.data

bm = bmesh.from_edit_mesh(me)

check the selected faces

for f in bm.faces: if f.select: print(f.index)

Blunder
  • 13,925
  • 4
  • 13
  • 36