def writePolylist(fp, mesh, config):
    progress = Progress(2)
    nFaces = len(mesh.fvert)
    fp.write((('        <polylist count="%d">\n' % nFaces) + ('          <input offset="0" semantic="VERTEX" source="#%s-Vertex"/>\n' % mesh.name)))
    if config.useNormals:
        fp.write((('          <input offset="1" semantic="NORMAL" source="#%s-Normals"/>\n' % mesh.name) + ('          <input offset="2" semantic="TEXCOORD" source="#%s-UV"/>\n' % mesh.name)))
    else:
        fp.write(('          <input offset="1" semantic="TEXCOORD" source="#%s-UV"/>\n' % mesh.name))
    vc = ''
    p = ''
    r = mesh.vertsPerFaceForExport
    for (fn, fv) in enumerate(mesh.fvert):
        fuv = mesh.fuvs[fn]
        vc += (str(r) + ' ')
        if config.useNormals:
            p += ''.join([('%d %d %d ' % (fv[n], fv[n], fuv[n])) for n in range(r)])
        else:
            p += ''.join([('%d %d ' % (fv[n], fuv[n])) for n in range(r)])
    fp.write((((((((('          <vcount>' + vc) + '\n') + '          </vcount>\n') + '          <p>') + p) + '\n') + '          </p>\n') + '        </polylist>\n'))
    progress.step()
def writePolylist(fp, mesh, config):
    progress = Progress(2)
    nFaces = len(mesh.fvert)
    fp.write((('        <polylist count="%d">\n' % nFaces) + ('          <input offset="0" semantic="VERTEX" source="#%s-Vertex"/>\n' % mesh.name)))
    if config.useNormals:
        fp.write((('          <input offset="1" semantic="NORMAL" source="#%s-Normals"/>\n' % mesh.name) + ('          <input offset="2" semantic="TEXCOORD" source="#%s-UV"/>\n' % mesh.name)))
    else:
        fp.write(('          <input offset="1" semantic="TEXCOORD" source="#%s-UV"/>\n' % mesh.name))
    vc = 
    p = 
    r = mesh.vertsPerFaceForExport
    for (fn, fv) in enumerate(mesh.fvert):
        fuv = mesh.fuvs[fn]
        vc += (str(r) + ' ')
        if config.useNormals:
            p += .join([('%d %d %d ' % (fv[n], fv[n], fuv[n])) for n in range(r)])
        else:
            p += .join([('%d %d ' % (fv[n], fuv[n])) for n in range(r)])
    fp.write((((((((('          <vcount>' + vc) + '\n') + '          </vcount>\n') + '          <p>') + p) + '\n') + '          </p>\n') + '        </polylist>\n'))
    progress.step()