示例#1
0
def process_meshes(zip_file):
    gltf = json.loads(zip_file.read("scene.gltf"))
    buffer = zip_file.read("scene.bin")

    drone_obj_data = dump_obj_data(gltf,
                                   buffer,
                                   0,
                                   with_skin=True,
                                   with_tangent=True)
    drone_filepath = os.path.join(DST_DIRECTORY, "drone.obj")
    with open(drone_filepath, "w") as f:
        f.write(drone_obj_data)

    for mesh_index in range(1, len(gltf["meshes"])):
        fire_obj_data = dump_obj_data(gltf, buffer, mesh_index)
        fire_filename = "fire{}.obj".format(mesh_index - 1)
        fire_filepath = os.path.join(DST_DIRECTORY, fire_filename)
        with open(fire_filepath, "w") as f:
            f.write(fire_obj_data)

    drone_ani_data = dump_skin_ani_data(gltf, buffer)
    drone_ani_filepath = os.path.join(DST_DIRECTORY, "drone.ani")
    with open(drone_ani_filepath, "w") as f:
        f.write(drone_ani_data)

    fire_ani_data, _ = dump_node_ani_data(gltf, buffer)
    fire_ani_filepath = os.path.join(DST_DIRECTORY, "fire.ani")
    with open(fire_ani_filepath, "w") as f:
        f.write(fire_ani_data)
示例#2
0
def process_mesh(zip_file):
    gltf = json.loads(zip_file.read(MODEL_DIR + "DamagedHelmet.gltf"))
    buffer = zip_file.read(MODEL_DIR + "DamagedHelmet.bin")

    obj_data = dump_obj_data(gltf, buffer, 0)
    filepath = os.path.join(DST_DIRECTORY, "helmet.obj")
    with open(filepath, "w") as f:
        f.write(obj_data)
示例#3
0
def process_meshes(zip_file):
    gltf = json.loads(zip_file.read("scene.gltf"))
    buffer = zip_file.read("scene.bin")

    for mesh_index, filename in enumerate(OBJ_FILENAMES):
        obj_data = dump_obj_data(gltf, buffer, mesh_index)
        filepath = os.path.join(DST_DIRECTORY, filename)
        with open(filepath, "w") as f:
            f.write(obj_data)
示例#4
0
def process_meshes(zip_file):
    gltf = json.loads(zip_file.read("scene.gltf"))
    buffer = zip_file.read("scene.bin")

    for mesh_index in range(len(gltf["meshes"])):
        obj_data = dump_obj_data(gltf, buffer, mesh_index)
        filename = "nier2b{}.obj".format(mesh_index)
        filepath = os.path.join(DST_DIRECTORY, filename)
        with open(filepath, "w") as f:
            f.write(obj_data)
示例#5
0
def process_meshes(zip_file):
    gltf = json.loads(zip_file.read("scene.gltf"))
    buffer = zip_file.read("scene.bin")

    obj_data = dump_obj_data(gltf, buffer, 0, with_skin=True)
    filepath = os.path.join(DST_DIRECTORY, "drone.obj")
    with open(filepath, "w") as f:
        f.write(obj_data)

    ani_data = dump_ani_data(gltf, buffer)
    ani_filepath = os.path.join(DST_DIRECTORY, "drone.ani")
    with open(ani_filepath, "w") as f:
        f.write(ani_data)
示例#6
0
def process_meshes(zip_file):
    gltf = json.loads(zip_file.read("scene.gltf"))
    buffer = zip_file.read("scene.bin")

    for mesh_index, obj_filename in enumerate(OBJ_FILENAMES):
        obj_data = dump_obj_data(gltf, buffer, mesh_index, with_skin=True)
        obj_filepath = os.path.join(DST_DIRECTORY, obj_filename)
        with open(obj_filepath, "w") as f:
            f.write(obj_data)

    ani_data = dump_skin_ani_data(gltf, buffer)
    ani_filepath = os.path.join(DST_DIRECTORY, "phoenix.ani")
    with open(ani_filepath, "w") as f:
        f.write(ani_data)
示例#7
0
def process_meshes(zip_file):
    gltf = json.loads(zip_file.read("scene.gltf"))
    buffer = zip_file.read("scene.bin")

    for mesh_index in range(len(gltf["meshes"])):
        obj_data = dump_obj_data(gltf, buffer, mesh_index)
        obj_filename = "whip{}.obj".format(mesh_index)
        obj_filepath = os.path.join(DST_DIRECTORY, obj_filename)
        with open(obj_filepath, "w") as f:
            f.write(obj_data)

    ani_data, _ = dump_node_ani_data(gltf, buffer)
    ani_filepath = os.path.join(DST_DIRECTORY, "whip.ani")
    with open(ani_filepath, "w") as f:
        f.write(ani_data)
示例#8
0
def process_meshes(zip_file):
    gltf = json.loads(zip_file.read("scene.gltf"))
    buffer = zip_file.read("scene.bin")

    for mesh_index in range(len(gltf["meshes"])):
        obj_data = dump_obj_data(gltf, buffer, mesh_index, with_tangent=True)
        obj_filename = "horse{}.obj".format(mesh_index)
        obj_filepath = os.path.join(DST_DIRECTORY, obj_filename)
        with open(obj_filepath, "w") as f:
            f.write(obj_data)

    ani_data = dump_skin_ani_data(gltf, buffer, animation_index=3)
    ani_filepath = os.path.join(DST_DIRECTORY, "horse.ani")
    with open(ani_filepath, "w") as f:
        f.write(ani_data)