#NEWLINE# def export( self ) : #NEWLINE# #INDENT# ret = [ ] #NEWLINE# verts_per_face = 3 #NEWLINE# normals = self . mesh_data . normals #NEWLINE# tex_coords = self . mesh_data . uv1 #NEWLINE# if ( not tex_coords ) : #NEWLINE# #INDENT# tex_coords = self . mesh_data . uv2 #NEWLINE# #UNINDENT# for v in self . mesh_data . vertices : #NEWLINE# #INDENT# ret . append ( ( 'v %s\n' % v ) ) #NEWLINE# #UNINDENT# for v in normals : #NEWLINE# #INDENT# ret . append ( ( 'vn %s\n' % v ) ) #NEWLINE# #UNINDENT# for v in tex_coords : #NEWLINE# #INDENT# ret . append ( ( 'vt %s\n' % v ) ) #NEWLINE# #UNINDENT# ret . append ( '\n' ) #NEWLINE# ret . append ( ( 'g %s\n' % self . mesh . name ) ) #NEWLINE# ret . append ( 's 1\n' ) #NEWLINE# sub_count = len ( self . mesh . submeshes ) #NEWLINE# for i in range ( 0 , sub_count ) : #NEWLINE# #INDENT# if ( sub_count == 1 ) : #NEWLINE# #INDENT# ret . append ( ( 'usemtl %s\n' % face_tri . mesh . name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret . append ( ( 'usemtl %s_%d\n' % ( self . mesh . name , i ) ) ) #NEWLINE# #UNINDENT# face_tri = [ ] #NEWLINE# for t in self . mesh_data . triangles [ i ] : #NEWLINE# #INDENT# face_tri . append ( t ) #NEWLINE# if ( len ( face_tri ) == verts_per_face ) : #NEWLINE# #INDENT# ret . append ( self . face_str ( face_tri , tex_coords , normals ) ) #NEWLINE# face_tri = [ ] #NEWLINE# #UNINDENT# #UNINDENT# ret . append ( '\n' ) #NEWLINE# #UNINDENT# return '' . join ( ret )