天命之子Live2D提取

@Pelom  January 1, 2019
该文章已过期,请阅读天命之子Live2D提取 - 2021重制版

前言

一年前玩过的游戏,当时玩的是韩服,福利很好;但是因为网络时好时坏,加之实在太休闲了,没玩儿多久就忘掉了,进而从手机上消失了
但有一说一,这个游戏的立绘全是live2d,贴图动作都做的不错,很社保厉害
今天突然心血来潮,就把live2d提取出来了(其实我一年前就提过)

预先准备

  • quickbms
  • Live2dViewer

在文末提供下载

步骤

  1. 下载天命之子并更新(此过程可能较慢,并且安装游戏需要谷歌三件套;此处使用的是日服安装包),live2d文件位于Android/data/stairs.destinychild/files/asset/character/,选择全部文件移动至电脑
  2. 运行quickbms.exe,依次选择destiny_child_kr.bms,所有live2d文件(后缀为.bms),导出目录(为了对应后面的操作,建议导出到DC/文件夹下)
  3. 导出的live2d文件无序且没有配置文件model.json,使用python程序整理并生成配置文件

    import os
    import sys
    import shutil
    import json
    
    if __name__ == '__main__':
        with open('model.json', "r", encoding="utf-8") as f:
            example = json.load(f)
        dirList = os.listdir('DC/')
        for i in dirList:
            del example['textures'][::]
            del example['expressions'][::]
            del example['motions'][''][::]
            pre = 'DC/' + i + '/'
            os.system('cd %s & ren *.dat *.exp.json' % (pre))
            os.system('cd %s & ren *.txt *.mtn' % (pre))
            fileList = os.listdir(pre)
            try:
                os.mkdir(pre + 'expressions/')
            except FileExistsError:
                pass
            try:
                os.mkdir(pre + 'motions/')
            except FileExistsError:
                pass
            try:
                os.mkdir(pre + 'textures/')
            except FileExistsError:
                pass
            textureCnt = 0
            for j in fileList:
                suf = j.split('.')[-1]
                if suf == 'moc':
                    os.rename(pre + j, pre + 'model.moc')
                elif suf == 'json':
                    newName = 'expressions/' + j.replace('000000', '')
                    shutil.move(pre + j, pre + newName)
                    example['expressions'].append({'name' : j.replace('000000', ''), 'file' : newName})
                elif suf == 'mtn':
                    newName = 'motions/' + j.replace('000000', '')
                    shutil.move(pre + j, pre + newName)
                    example['motions'][''].append({'file' : newName})
                elif suf == 'png':
                    newName = 'textures/texture_' + '0' + str(textureCnt) + '.png'
                    shutil.move(pre + j, pre + newName)
                    example['textures'].append(newName)
                    textureCnt = textureCnt + 1
            with open(pre + 'model.json', 'w', encoding="utf-8") as f:
                json.dump(example, f, indent=4, separators=(',', ':'))
            sys.stdout.write("完成%s\n" % (i))
        input("全部完成!")

    请将此程序与model.json移动至DC文件夹同目录下运行

  4. 查看可使用Live2dViewer,拖入model.json文件即可

下载


请勿用作商业用途


添加新评论