[Bf-python] Images on faces.

Campbell Barton cbarton at metavr.com
Thu Oct 27 01:41:01 CEST 2005


Hi Ken, just updating some more scripts to use Mesh. Something I noticed 
is that asking for face.image raises an error.

Wity NMesh "image.face" can be None and set to None, wich I found usefull.

# NMesh
for f in me.faces:
  if f.image and f.image.name == 'somename.png':
     ...do somthing

# With Mesh.. probably not the best example. better to check for image 
flag..  still.
for f in me.faces:
  image = None
  try: image = f.image
  except: pass
  if f.image and f.image.name == 'somename.png':
     ...do


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241



More information about the Bf-python mailing list