예제 #1
0
def exportAsset(model, asset):
    out = toolbox.writeAny(asset)
    md3_object = MD3Object()
    meshes = model.getMeshes()
    #TODO: Put stuff into the MD3Object here()
    out.write(md3_object.pack())
    out.close()
예제 #2
0
파일: md3.py 프로젝트: kblin/plunger
def exportAsset(model, asset):
    out = toolbox.writeAny(asset)
    md3_object = MD3Object()
    meshes = model.getMeshes()
    #TODO: Put stuff into the MD3Object here()
    out.write(md3_object.pack())
    out.close()
예제 #3
0
파일: ogrexml.py 프로젝트: kblin/plunger
def exportAsset(model, asset):
    g = Generator()
    g.generate(model)

    import sys
    file = None
    try:
        file = toolbox.writeAny(asset)
    except IOError:
        print "Failed to open '%s' for writing" % asset
        sys.exit(1)

    try:
        file.write(g.toxml())
        file.close()
    except IOError:
        print "Writing '%s' failed." % asset
        sys.exit(1)
예제 #4
0
파일: ogrexml.py 프로젝트: kblin/plunger
def exportAsset(model, asset):
    g = Generator()
    g.generate(model)

    import sys
    file = None
    try:
        file = toolbox.writeAny(asset)
    except IOError:
        print "Failed to open '%s' for writing" % asset
        sys.exit(1)

    try:
        file.write(g.toxml())
        file.close()
    except IOError:
        print "Writing '%s' failed." % asset
        sys.exit(1)
예제 #5
0
파일: sear.py 프로젝트: kblin/plunger
def exportAsset(model, asset):
    out = toolbox.writeAny(asset)
    sear_object = SearObject()
    sear_object.header.num_meshes = model.getNumMeshes()
    meshes = model.getMeshes()

    for mesh in meshes:
        sear_mesh = SearObjectMesh()
        if mesh.getMaterials():
            sear_mesh.texture_map = mesh.getMaterials()[0].getPath()
        sear_mesh.num_vertices = mesh.getNumVertices()
        for vertex in mesh.getVertices():
            sear_mesh.vertices.append(vertex.getPosition())
            sear_mesh.normals.append(vertex.getNormals())
            tex_coords = vertex.getUVCoords()
            sear_mesh.texture_coords.append(tex_coords and tex_coords or [0,0])
        sear_mesh.num_faces = mesh.getNumFaces()
        sear_mesh.indices = mesh.getFaces()
        sear_object.meshes.append(sear_mesh)

    out.write(sear_object.pack())
    out.close()
예제 #6
0
def exportAsset(model, asset):
    out = toolbox.writeAny(asset)
    sear_object = SearObject()
    sear_object.header.num_meshes = model.getNumMeshes()
    meshes = model.getMeshes()

    for mesh in meshes:
        sear_mesh = SearObjectMesh()
        if mesh.getMaterials():
            sear_mesh.texture_map = mesh.getMaterials()[0].getPath()
        sear_mesh.num_vertices = mesh.getNumVertices()
        for vertex in mesh.getVertices():
            sear_mesh.vertices.append(vertex.getPosition())
            sear_mesh.normals.append(vertex.getNormals())
            tex_coords = vertex.getUVCoords()
            sear_mesh.texture_coords.append(tex_coords and tex_coords
                                            or [0, 0])
        sear_mesh.num_faces = mesh.getNumFaces()
        sear_mesh.indices = mesh.getFaces()
        sear_object.meshes.append(sear_mesh)

    out.write(sear_object.pack())
    out.close()
예제 #7
0
파일: info.py 프로젝트: kblin/plunger
def exportAsset(model, asset):
    out = toolbox.writeAny(asset)
    printDelimiter(out)
    out.write("Plunger Info plugin version %s\n" % version)
    exportMeshInfo(model, out)
    out.close()
예제 #8
0
def exportAsset(model, asset):
    out = toolbox.writeAny(asset)
    printDelimiter(out)
    out.write("Plunger Info plugin version %s\n" % version)
    exportMeshInfo(model, out)
    out.close()