Index: uv_export.py =================================================================== RCS file: /cvsroot/bf-blender/blender/release/scripts/uv_export.py,v retrieving revision 1.18 diff -u -r1.18 uv_export.py --- uv_export.py 26 Mar 2007 15:55:23 -0000 1.18 +++ uv_export.py 8 May 2007 04:31:42 -0000 @@ -101,6 +101,8 @@ FullPython = False import Blender +import bpy +import BPyMessages try: import os @@ -175,18 +177,14 @@ obj = Blender.Scene.GetCurrent().objects.active time1= Blender.sys.time() - - if not obj: - Blender.Draw.PupMenu("ERROR%t|No Active Object!") - return if obj.type != "Mesh": - Blender.Draw.PupMenu("ERROR%t|Not a Mesh!") + BPyMessages.Error_NoMeshActive() return - mesh = obj.getData() - if not mesh.hasFaceUV(): - Blender.Draw.PupMenu("ERROR%t|No UV coordinates!") + mesh = obj.getData(mesh=1) + if not mesh.faceUV: + BPyMessages.Error_NoMeshUvActive() return # just for information... @@ -259,18 +257,9 @@ return filename def ExtractUVFaces(mesh, allface): - FaceList = [] - - if allface: - faces = mesh.faces - else: - faces = mesh.getSelectedFaces() - - for f in faces: - FaceList.append(f.uv) - return FaceList - + if allface: return [f.uv for f in mesh.faces] + else: return [f.uv for f in mesh.faces if f.sel] def Buffer(height=16, width=16, profondeur=1,rvb=255 ): """