more updates, mostly 2.3 error checking, nice messages when pythons not installed and some nendo import optimizations.

BPyMesh will work with the exception of the redux function in py2.3
This commit is contained in:
2006-07-03 20:17:40 +00:00
parent 64ff9ae4a8
commit c4b4e2922f
6 changed files with 106 additions and 71 deletions

View File

@@ -49,14 +49,21 @@ def file_callback(filename):
return
file = open(filename, 'wb')
mesh = BPyMesh.getMeshFromObject(object, None, True, False, scn)
if not mesh:
Blender.Draw.PupMenu('Error%t|Could not get mesh data from active object')
return
mesh.transform(object.matrixWorld)
have_uv = mesh.faceUV
if mesh.vertexColors or mesh.faceUV:
mesh.faceUV= 1
have_uv= True
else:
have_uv= False
verts = [] # list of dictionaries
vdict = {} # (index, normal, uv) -> new index
for i, f in enumerate(mesh.faces):
@@ -130,4 +137,11 @@ def file_callback(filename):
file.write('\n')
file.close()
Blender.Window.FileSelector(file_callback, 'PLY Export', Blender.sys.makename(ext='.ply'))
def main():
Blender.Window.FileSelector(file_callback, 'PLY Export', Blender.sys.makename(ext='.ply'))
if __name__=='__main__':
main()