Labeling selected faces in operator

I’m developing an addon similar to the Make Planar Faces operator already available in Blender. The user selects a vertex, which will be moved (along selected directions) in order to make all connected faces as planar as possible. It would be nice to let the user set some parameters for specific connected faces, eg, the weight of the ‘planarness’ of that face. It obviously needs to be clear which face the user is setting the parameters for, so you might want something like this:


It looks a bit like what you get when you tell Blender to display the area of the selected faces. Is this possible in a custom operator? Any examples I could check? TIA!

MeasureIt has face labeling in it’s ‘Mesh Debug’ options. I think it uses the faces’ mesh index for the label. I can’t remember what the exact code was, but think it used something like this for retrieving the face index data:

for o in bpy.context.scene.objects:
   if type(o) == 'MESH':
      for p in o.data.polygons:
         index = o.index

Great, that looks exactly like the example I was looking for! It appears to use opengl to draw text and lines and such, which will be very interesting to look into, indeed. Thank you! :slight_smile: