In Blender 2.79, how can I find the per-face UV image associated with a given face? Essentially what I want to do is this (pseudocode):

for face in mesh:
  if face.uv_image == "some_image.png":
      do something
      do something_else
  • $\begingroup$ Dont think images are assigned on a per face basis. Look at the python operator mesh uv template in text editor. $\endgroup$ – batFINGER May 3 '19 at 18:48
  • $\begingroup$ It's a fairly antiquated feature but it does exist. Generally Blender refers to per-face images as "TexFace" $\endgroup$ – John Allie May 3 '19 at 19:19

Found it. This code prints the name of the TexFace image for each face of the mesh:

import bpy

object = bpy.context.object
mesh = object.data

for face in mesh.uv_textures['UVMap'].data:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.