diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..10b731c --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ diff --git a/.idea/git_toolbox_blame.xml b/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000..7dc1249 --- /dev/null +++ b/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/live2d-widget.iml b/.idea/live2d-widget.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/live2d-widget.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ff57eb7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 7cc4480..e646cc1 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,11 @@ ## 使用 如果你是小白,或者只需要最基础的功能,那么只用将这一行代码加入 html 页面的 `head` 或 `body` 中,即可加载看板娘: + ```xml ``` + 添加代码的位置取决于你的网站的构建方式。例如,如果你使用的是 [Hexo](https://hexo.io),那么需要在主题的模版文件中添加以上代码。对于用各种模版引擎生成的页面,修改方法类似。 如果网站启用了 PJAX,由于看板娘不必每页刷新,需要注意将该脚本放到 PJAX 刷新区域之外。 @@ -39,12 +41,15 @@ 你可以对照 `autoload.js` 的源码查看可选的配置项目。`autoload.js` 会自动加载三个文件:`waifu.css`,`live2d.min.js` 和 `waifu-tips.js`。`waifu-tips.js` 会创建 `initWidget` 函数,这就是加载看板娘的主函数。`initWidget` 函数接收一个 Object 类型的参数,作为看板娘的配置。以下是配置选项: -| 选项 | 类型 | 默认值 | 说明 | -| - | - | - | - | -| `waifuPath` | `string` | `https://fastly.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/waifu-tips.json` | 看板娘资源路径,可自行修改 | -| `apiPath` | `string` | `https://live2d.fghrsh.net/api/` | API 路径,可选参数 | -| `cdnPath` | `string` | `https://fastly.jsdelivr.net/gh/fghrsh/live2d_api/` | CDN 路径,可选参数 | -| `tools` | `string[]` | 见 `autoload.js` | 加载的小工具按钮,可选参数 | +| 选项 | 类型 | 默认值 | 说明 | +| --------------- | ---------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------- | +| `waifuPath` | `string` | `https://fastly.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/waifu-tips.json` | 看板娘资源路径,可自行修改 | +| `apiPath` | `string` | `https://live2d.fghrsh.net/api/` | API 路径,可选参数 | +| `cdnPath` | `string` | `https://fastly.jsdelivr.net/gh/fghrsh/live2d_api/` | CDN 路径,可选参数 | +| `tools` | `string[]` | 见 `autoload.js` | 加载的小工具按钮,可选参数 | +| `isLocalModel` | `boolearn` | 见 `demo.js` | 是否开启使用本地模型,不声明就是使用远程 | +| `modelsPath` | ` string` | 见 `demo.js` | 本地模型文件夹所在目录,设置本地后必须要设置 | +| `modelListPath` | `string` | 见 `demo.js` | 模型列表,如果不写,就约定为 `modelsPath` 下的 `model_list.json` 文件 | 其中,`apiPath` 和 `cdnPath` 两个参数设置其中一项即可。`apiPath` 是后端 API 的 URL,可以自行搭建,并增加模型(需要修改的内容比较多,此处不再赘述),可以参考 [live2d_api](https://github.com/fghrsh/live2d_api)。而 `cdnPath` 则是通过 jsDelivr 这样的 CDN 服务加载资源,更加稳定。 @@ -77,10 +82,13 @@ npm run build ### 使用 CDN 要自定义有关内容,可以把这个仓库 Fork 一份,然后把修改后的内容通过 git push 到你的仓库中。这时,使用方法对应地变为 + ```xml ``` + 将此处的 `username` 替换为你的 GitHub 用户名。为了使 CDN 的内容正常刷新,需要创建新的 git tag 并推送至 GitHub 仓库中,否则此处的 `@latest` 仍然指向更新前的文件。此外 CDN 本身存在缓存,因此改动可能需要一定的时间生效。相关文档: + - [Git Basics - Tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging) - [Managing releases in a repository](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) @@ -94,18 +102,24 @@ npm run build 这样,整个项目就可以通过你的域名访问了。不妨试试能否正常地通过浏览器打开 `autoload.js` 和 `live2d.min.js` 等文件,并确认这些文件的内容是完整和正确的。 一切正常的话,接下来修改 `autoload.js` 中的常量 `live2d_path` 为 `live2d-widget` 这一目录的 URL 即可。比如说,如果你能够通过 + ``` https://example.com/path/to/live2d-widget/live2d.min.js ``` + 访问到 `live2d.min.js`,那么就把 `live2d_path` 的值修改为 + ``` https://example.com/path/to/live2d-widget/ ``` + 路径末尾的 `/` 一定要加上。 完成后,在你要添加看板娘的界面加入 + ```xml ``` + 就可以加载了。 ## 鸣谢 @@ -181,9 +195,9 @@ https://community.live2d.com/discussion/140/webgl-developer-licence-and-javascri ## 更新日志 -2018年10月31日,由 fghrsh 提供的原 API 停用,请更新至新地址。参考文章: +2018 年 10 月 31 日,由 fghrsh 提供的原 API 停用,请更新至新地址。参考文章: https://www.fghrsh.net/post/170.html -2020年1月1日起,本项目不再依赖于 jQuery。 +2020 年 1 月 1 日起,本项目不再依赖于 jQuery。 -2022年11月1日起,本项目不再需要用户单独加载 Font Awesome。 +2022 年 11 月 1 日起,本项目不再需要用户单独加载 Font Awesome。 diff --git a/demo/demo.html b/demo/demo.html index 12ed9cf..7ccb681 100755 --- a/demo/demo.html +++ b/demo/demo.html @@ -29,6 +29,6 @@ - + diff --git a/demo/demo.js b/demo/demo.js new file mode 100644 index 0000000..3fa5503 --- /dev/null +++ b/demo/demo.js @@ -0,0 +1,62 @@ +const live2d_path = "../"; + +// 封装异步加载资源的方法 +function loadExternalResource(url, type) { + return new Promise((resolve, reject) => { + let tag; + + if (type === "css") { + tag = document.createElement("link"); + tag.rel = "stylesheet"; + tag.href = url; + } else if (type === "js") { + tag = document.createElement("script"); + tag.src = url; + } + if (tag) { + tag.onload = () => resolve(url); + tag.onerror = () => reject(url); + document.head.appendChild(tag); + } + }); +} + +// 加载 waifu.css live2d.min.js waifu-tips.js +if (screen.width >= 768) { + Promise.all([ + loadExternalResource(live2d_path + "waifu.css", "css"), + loadExternalResource(live2d_path + "live2d.min.js", "js"), + loadExternalResource(live2d_path + "waifu-tips.js", "js"), + ]).then(() => { + // 配置选项的具体用法见 README.md + initWidget({ + waifuPath: live2d_path + "waifu-tips.json", + isLocalModel: true, // 使用本地模型 + modelListPath: live2d_path + "demo/model/model_list.json", + modelsPath: live2d_path + "demo/model", + //apiPath: "https://live2d.fghrsh.net/api/", + // cdnPath: "https://fastly.jsdelivr.net/gh/fghrsh/live2d_api/", + tools: ["hitokoto", "asteroids", "switch-model", "switch-texture", "photo", "info", "quit"], + }); + }); +} + +console.log(` + く__,.ヘヽ. / ,ー、 〉 + \ ', !-─‐-i / /´ + /`ー' L//`ヽ、 + / /, /| , , ', + イ / /-‐/ i L_ ハ ヽ! i + レ ヘ 7イ`ト レ'ァ-ト、!ハ| | + !,/7 '0' ´0iソ| | + |.从" _ ,,,, / |./ | + レ'| i>.、,,__ _,.イ / .i | + レ'| | / k_7_/レ'ヽ, ハ. | + | |/i 〈|/ i ,.ヘ | i | + .|/ / i: ヘ! \ | + kヽ>、ハ _,.ヘ、 /、! + !'〈//`T´', \ `'7'ーr' + レ'ヽL__|___i,___,ンレ|ノ + ト-,/ |___./ + 'ー' !_,.: +`); diff --git a/demo/model/bilibili22/index.json b/demo/model/bilibili22/index.json new file mode 100644 index 0000000..9a4a5e2 --- /dev/null +++ b/demo/model/bilibili22/index.json @@ -0,0 +1,40 @@ +{ + "type":"Live2D Model Setting", + "name":"22-3695903", + "label":"22", + "model":"model.moc", + "textures":[ + "texture_00/closet-default-v2.png", + "texture_01/default-upper.png", + "texture_02/default-lower.png", + "texture_03/default-hat.png" + ], + "layout":{ + "center_x": 0, + "center_y": 0.1, + "width": 2.3, + "height": 2.3 + }, + "hit_areas_custom":{ + "head_x":[-0.33, 0.6], + "head_y":[0.19, -0.2], + "body_x":[-0.3, -0.25], + "body_y":[0.3, -0.9] + }, + "motions":{ + "idle":[ + {"file":"motions/idle-01.mtn","fade_in":2000,"fade_out":2000}, + {"file":"motions/idle-02.mtn","fade_in":2000,"fade_out":2000}, + {"file":"motions/idle-03.mtn","fade_in":100,"fade_out":100} + ], + "flick_head":[ + {"file":"motions/touch.mtn","fade_in":500,"fade_out":200} + ], + "tap_body":[ + {"file":"motions/touch.mtn","fade_in":500,"fade_out":200} + ], + "thanking":[ + {"file":"motions/thanking.mtn","fade_in":2000,"fade_out":2000} + ] + } +} \ No newline at end of file diff --git a/demo/model/bilibili22/model.moc b/demo/model/bilibili22/model.moc new file mode 100644 index 0000000..b08a53a Binary files /dev/null and b/demo/model/bilibili22/model.moc differ diff --git a/demo/model/bilibili22/motions/idle-01.mtn b/demo/model/bilibili22/motions/idle-01.mtn new file mode 100644 index 0000000..b78ac62 --- /dev/null +++ b/demo/model/bilibili22/motions/idle-01.mtn @@ -0,0 +1,40 @@ +# Live2D Animator Motion Data +$fps=30 + +$fadein=0 + +$fadeout=0 + +PARAM_ANGLE_X=2,1.987,1.95,1.89,1.81,1.7,1.58,1.45,1.3,1.14,0.96,0.78,0.59,0.4,0.2,0,-0.2,-0.4,-0.59,-0.78,-0.96,-1.14,-1.3,-1.45,-1.58,-1.7,-1.81,-1.89,-1.95,-1.99,-2,-1.987,-1.95,-1.89,-1.81,-1.7,-1.58,-1.45,-1.3,-1.14,-0.96,-0.78,-0.59,-0.4,-0.2,0,0.2,0.4,0.59,0.78,0.96,1.14,1.3,1.45,1.58,1.7,1.81,1.89,1.95,1.99,2,1.987,1.95,1.89,1.81,1.7,1.58,1.45,1.3,1.14,0.96,0.78,0.59,0.4,0.2,0,-0.2,-0.4,-0.59,-0.78,-0.96,-1.14,-1.3,-1.45,-1.58,-1.7,-1.81,-1.89,-1.95,-1.99,-2,-1.987,-1.95,-1.89,-1.81,-1.7,-1.58,-1.45,-1.3,-1.14,-0.96,-0.78,-0.59,-0.4,-0.2,0,0.2,0.4,0.59,0.78,0.96,1.14,1.3,1.45,1.58,1.7,1.81,1.89,1.95,1.99,2 +PARAM_ANGLE_Y=8,7.91,7.66,7.27,6.77,6.18,5.53,4.85,4.15,3.47,2.82,2.23,1.73,1.34,1.09,1,1.11,1.43,1.94,2.58,3.34,4.17,5.05,5.95,6.83,7.66,8.42,9.06,9.57,9.89,10,9.89,9.57,9.06,8.42,7.66,6.83,5.95,5.05,4.17,3.34,2.58,1.94,1.43,1.11,1,1.09,1.34,1.73,2.23,2.82,3.47,4.15,4.85,5.53,6.18,6.77,7.27,7.66,7.91,8,7.91,7.66,7.27,6.77,6.18,5.53,4.85,4.15,3.47,2.82,2.23,1.73,1.34,1.09,1,1.11,1.43,1.94,2.58,3.34,4.17,5.05,5.95,6.83,7.66,8.42,9.06,9.57,9.89,10,9.89,9.57,9.06,8.42,7.66,6.83,5.95,5.05,4.17,3.34,2.58,1.94,1.43,1.11,1,1.09,1.34,1.73,2.23,2.82,3.47,4.15,4.85,5.53,6.18,6.77,7.27,7.66,7.91,8 +PARAM_ANGLE_Z=6,5.96,5.86,5.69,5.47,5.18,4.85,4.48,4.07,3.63,3.15,2.65,2.13,1.59,1.05,0.5,-0.05,-0.59,-1.13,-1.65,-2.15,-2.63,-3.07,-3.48,-3.85,-4.18,-4.47,-4.69,-4.86,-4.96,-5,-4.96,-4.86,-4.69,-4.47,-4.18,-3.85,-3.48,-3.07,-2.63,-2.15,-1.65,-1.13,-0.59,-0.05,0.5,1.05,1.59,2.13,2.65,3.15,3.63,4.07,4.48,4.85,5.18,5.47,5.69,5.86,5.96,6,5.96,5.86,5.69,5.47,5.18,4.85,4.48,4.07,3.63,3.15,2.65,2.13,1.59,1.05,0.5,-0.05,-0.59,-1.13,-1.65,-2.15,-2.63,-3.07,-3.48,-3.85,-4.18,-4.47,-4.69,-4.86,-4.96,-5,-4.96,-4.86,-4.69,-4.47,-4.18,-3.85,-3.48,-3.07,-2.63,-2.15,-1.65,-1.13,-0.59,-0.05,0.5,1.05,1.59,2.13,2.65,3.15,3.63,4.07,4.48,4.85,5.18,5.47,5.69,5.86,5.96,6 +PARAM_EYE_L_OPEN=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.76,0.36,0.09,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.76,0.36,0.09,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +PARAM_EYE_R_OPEN=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.76,0.36,0.09,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.76,0.36,0.09,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +PARAM_EYE_L=0,0.007,0.026,0.06,0.09,0.14,0.2,0.26,0.32,0.39,0.46,0.54,0.61,0.68,0.74,0.8,0.86,0.91,0.94,0.97,0.993,1,0.97,0.87,0.74,0.58,0.42,0.26,0.13,0.03,0,0.009,0.03,0.07,0.13,0.19,0.26,0.33,0.41,0.49,0.57,0.65,0.72,0.79,0.85,0.9,0.94,0.97,0.993,1,1,1,1,1,0.93,0.75,0.53,0.32,0.15,0.04,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_EYEK_R=0,0.007,0.026,0.06,0.09,0.14,0.2,0.26,0.32,0.39,0.46,0.54,0.61,0.68,0.74,0.8,0.86,0.91,0.94,0.97,0.993,1,0.97,0.87,0.74,0.58,0.42,0.26,0.13,0.03,0,0.009,0.03,0.07,0.13,0.19,0.26,0.33,0.41,0.49,0.57,0.65,0.72,0.79,0.85,0.9,0.94,0.97,0.993,1,1,1,1,1,0.93,0.75,0.53,0.32,0.15,0.04,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_EYE_BALL_X=-0.06,-0.06,-0.059,-0.057,-0.055,-0.052,-0.049,-0.046,-0.041,-0.037,-0.032,-0.026,-0.02,-0.014,-0.007,0,0.007,0.013,0.019,0.024,0.029,0.033,0.037,0.04,0.043,0.045,0.047,0.048,0.049,0.05,0.05,0.049,0.048,0.045,0.041,0.037,0.032,0.027,0.023,0.018,0.013,0.009,0.005,0.002,0.001,0,0,0,0,0,0,0,0,0,-0.004,-0.015,-0.028,-0.041,-0.051,-0.058,-0.06,-0.06,-0.059,-0.057,-0.055,-0.052,-0.049,-0.046,-0.041,-0.037,-0.032,-0.026,-0.02,-0.014,-0.007,0,0.007,0.013,0.019,0.024,0.029,0.033,0.037,0.04,0.043,0.045,0.047,0.048,0.049,0.05,0.05,0.05,0.05,0.048,0.047,0.045,0.043,0.04,0.037,0.033,0.029,0.024,0.019,0.013,0.007,0,-0.007,-0.014,-0.02,-0.026,-0.032,-0.037,-0.041,-0.046,-0.049,-0.052,-0.055,-0.057,-0.059,-0.06,-0.06 +PARAM_EYE_BALL_Y=-0.25,-0.246,-0.234,-0.216,-0.19,-0.16,-0.13,-0.1,-0.07,-0.04,-0.01,0.02,0.05,0.064,0.076,0.08,0.075,0.06,0.04,0.01,-0.03,-0.06,-0.1,-0.15,-0.19,-0.22,-0.26,-0.29,-0.31,-0.325,-0.33,-0.325,-0.31,-0.29,-0.26,-0.22,-0.19,-0.15,-0.1,-0.06,-0.03,0.01,0.04,0.06,0.075,0.08,0.08,0.078,0.074,0.067,0.057,0.043,0.024,0,-0.04,-0.09,-0.15,-0.19,-0.22,-0.24,-0.25,-0.246,-0.234,-0.216,-0.19,-0.16,-0.13,-0.1,-0.07,-0.04,-0.01,0.02,0.05,0.064,0.076,0.08,0.075,0.06,0.04,0.01,-0.03,-0.06,-0.1,-0.15,-0.19,-0.22,-0.26,-0.29,-0.31,-0.325,-0.33,-0.325,-0.31,-0.29,-0.26,-0.22,-0.19,-0.15,-0.1,-0.06,-0.03,0.01,0.04,0.06,0.075,0.08,0.076,0.064,0.046,0.02,-0.01,-0.04,-0.07,-0.1,-0.13,-0.16,-0.19,-0.22,-0.234,-0.246,-0.25 +PARAM_MOUTH_OPEN_Y=0 +PARAM_CHEEK=0 +PARAM_ARMR_ANGLE_Z=0 +PARAM_ARML_ANGLE_Z=0 +PARAM_BODY_ANGLE_X=0 +PARAM_BODY_ANGLE_Z=0 +PARAM_BODY2_ANGLE_Z=-1,-0.994,-0.975,-0.94,-0.9,-0.85,-0.79,-0.72,-0.65,-0.57,-0.48,-0.39,-0.3,-0.2,-0.1,0,0.1,0.2,0.3,0.39,0.48,0.57,0.65,0.72,0.79,0.85,0.9,0.94,0.97,0.994,1,0.994,0.975,0.94,0.9,0.85,0.79,0.72,0.65,0.57,0.48,0.39,0.3,0.2,0.1,0,-0.1,-0.2,-0.3,-0.39,-0.48,-0.57,-0.65,-0.72,-0.79,-0.85,-0.9,-0.94,-0.97,-0.994,-1,-0.994,-0.975,-0.94,-0.9,-0.85,-0.79,-0.72,-0.65,-0.57,-0.48,-0.39,-0.3,-0.2,-0.1,0,0.1,0.2,0.3,0.39,0.48,0.57,0.65,0.72,0.79,0.85,0.9,0.94,0.97,0.994,1,0.994,0.975,0.94,0.9,0.85,0.79,0.72,0.65,0.57,0.48,0.39,0.3,0.2,0.1,0,-0.1,-0.2,-0.3,-0.39,-0.48,-0.57,-0.65,-0.72,-0.79,-0.85,-0.9,-0.94,-0.97,-0.994,-1 +PARAM_BODY3_ANGLE_Z=1,0.994,0.975,0.94,0.9,0.85,0.79,0.72,0.65,0.57,0.48,0.39,0.3,0.2,0.1,0,-0.1,-0.2,-0.3,-0.39,-0.48,-0.57,-0.65,-0.72,-0.79,-0.85,-0.9,-0.94,-0.97,-0.994,-1,-0.994,-0.975,-0.94,-0.9,-0.85,-0.79,-0.72,-0.65,-0.57,-0.48,-0.39,-0.3,-0.2,-0.1,0,0.1,0.2,0.3,0.39,0.48,0.57,0.65,0.72,0.79,0.85,0.9,0.94,0.97,0.994,1,0.994,0.975,0.94,0.9,0.85,0.79,0.72,0.65,0.57,0.48,0.39,0.3,0.2,0.1,0,-0.1,-0.2,-0.3,-0.39,-0.48,-0.57,-0.65,-0.72,-0.79,-0.85,-0.9,-0.94,-0.97,-0.994,-1,-0.994,-0.975,-0.94,-0.9,-0.85,-0.79,-0.72,-0.65,-0.57,-0.48,-0.39,-0.3,-0.2,-0.1,0,0.1,0.2,0.3,0.39,0.48,0.57,0.65,0.72,0.79,0.85,0.9,0.94,0.97,0.994,1 +VISIBLE:ROUGH=1 +VISIBLE:PARTS_01_FACE_001=1 +VISIBLE:PARTS_01_EYE_001=1 +VISIBLE:PARTS_01_EYE_BALL_001=1 +VISIBLE:PARTS_01_BROW_001=1 +VISIBLE:PARTS_01_MOUTH_001=1 +VISIBLE:PARTS_01_NOSE_001=1 +VISIBLE:PARTS_01_EAR_001=1 +VISIBLE:PARTS_01_HAIR_FRONT_001=1 +VISIBLE:PARTS_01_HAIR_SIDE_001=1 +VISIBLE:PARTS_01_HAIR_BACK_001=1 +VISIBLE:PARTS_01_NECK=1 +VISIBLE:PARTS_01_BODY=1 +VISIBLE:PARTS_01_LEGS=1 +VISIBLE:PARTS_01_BACKGROUND=1 +VISIBLE:PARTS_01_SKETCH=0 \ No newline at end of file diff --git a/demo/model/bilibili22/motions/idle-02.mtn b/demo/model/bilibili22/motions/idle-02.mtn new file mode 100644 index 0000000..70076e5 --- /dev/null +++ b/demo/model/bilibili22/motions/idle-02.mtn @@ -0,0 +1,41 @@ +# Live2D Animator Motion Data +$fps=30 + +$fadein=0 + +$fadeout=0 + +PARAM_ANGLE_X=2,1.998,1.992,1.981,1.965,1.945,1.92,1.89,1.85,1.81,1.76,1.71,1.64,1.58,1.5,1.42,1.33,1.24,1.13,1.02,0.9,0.77,0.64,0.49,0.34,0.17,0,-1.86,-6.09,-11.64,-17.16,-21.3,-23,-22.21,-20.09,-17.02,-13.38,-9.62,-5.98,-2.91,-0.79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.03,0.1,0.21,0.35,0.51,0.69,0.88,1.07,1.26,1.43,1.59,1.73,1.84,1.93,1.98,2 +PARAM_ANGLE_Y=8,7.93,7.74,7.43,7.03,6.55,6.01,5.43,4.81,4.18,3.56,2.94,2.37,1.83,1.38,1,0.66,0.41,0.24,0.12,0.05,0.01,-0.011,-0.015,-0.01,-0.004,0,2.25,7.73,15,22.27,27.75,30,28.97,26.2,22.2,17.45,12.55,7.8,3.8,1.03,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1,0.39,0.83,1.39,2.05,2.78,3.52,4.28,5.02,5.73,6.36,6.92,7.38,7.72,7.93,8 +PARAM_ANGLE_Z=6,5.987,5.95,5.88,5.78,5.66,5.5,5.32,5.1,4.86,4.58,4.27,3.92,3.53,3.12,2.67,2.17,1.65,1.08,0.47,-0.18,-0.87,-1.6,-2.38,-3.21,-4.08,-5,-7.04,-10.51,-14.73,-18.8,-21.79,-23,-21.45,-17.3,-11.29,-4.18,3.18,10.29,16.3,20.45,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,21.82,21.32,20.51,19.44,18.16,16.7,15.05,13.35,11.52,9.67,7.79,5.98,4.18,2.49,0.89,-0.54,-1.82,-2.93,-3.81,-4.46,-4.86,-5,-4.86,-4.47,-3.86,-3.08,-2.18,-1.18,-0.16,0.89,1.9,2.88,3.75,4.52,5.15,5.61,5.9,6 +PARAM_EYE_L_OPEN=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.92,0.74,0.5,0.26,0.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1 +PARAM_EYE_R_OPEN=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.92,0.74,0.5,0.26,0.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1 +PARAM_EYE_L=0 +PARAM_EYEK_R=0 +PARAM_EYE_BALL_X=-0.06,-0.06,-0.058,-0.056,-0.054,-0.05,-0.046,-0.042,-0.038,-0.033,-0.027,-0.022,-0.016,-0.011,-0.005,0,0.006,0.01,0.013,0.015,0.017,0.018,0.019,0.02,0.02,0.02,0.02,0.02,0.02,0.018,0.016,0.015,0.013,0.011,0.009,0.007,0.005,0.004,0.002,0.001,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.003,-0.006,-0.01,-0.015,-0.021,-0.026,-0.032,-0.038,-0.043,-0.048,-0.052,-0.055,-0.058,-0.059,-0.06 +PARAM_EYE_BALL_Y=-0.25,-0.246,-0.234,-0.216,-0.19,-0.16,-0.13,-0.1,-0.07,-0.04,-0.01,0.02,0.05,0.064,0.076,0.08,0.073,0.056,0.03,0.01,-0.02,-0.05,-0.07,-0.1,-0.114,-0.126,-0.13,-0.128,-0.124,-0.116,-0.107,-0.096,-0.084,-0.071,-0.059,-0.046,-0.034,-0.023,-0.014,-0.006,-0.002,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.003,-0.012,-0.026,-0.044,-0.06,-0.09,-0.11,-0.13,-0.16,-0.18,-0.199,-0.216,-0.231,-0.241,-0.248,-0.25 +PARAM_MOUTH_OPEN_Y=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.013,0.05,0.1,0.18,0.26,0.35,0.45,0.55,0.65,0.74,0.82,0.9,0.95,0.99,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.993,0.975,0.94,0.91,0.86,0.8,0.74,0.68,0.61,0.54,0.47,0.41,0.34,0.28,0.22,0.17,0.12,0.08,0.04,0.02,0.005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_CHEEK=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.013,0.05,0.1,0.18,0.26,0.35,0.45,0.55,0.65,0.74,0.82,0.9,0.95,0.99,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.76,0.36,0.09,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_ARMR_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.003,-0.01,-0.022,-0.037,-0.055,-0.074,-0.095,-0.12,-0.136,-0.155,-0.173,-0.188,-0.2,-0.207,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.209,-0.21,-0.21,-0.208,-0.21,-0.207,-0.206,-0.21,-0.204,-0.203,-0.202,-0.201,-0.2,-0.198,-0.194,-0.189,-0.183,-0.175,-0.167,-0.157,-0.147,-0.137,-0.126,-0.114,-0.103,-0.091,-0.079,-0.068,-0.057,-0.046,-0.035,-0.026,-0.016,-0.008,0,0.007,0.01,0.01,0.01,0.01,0.01,0.008,0.007,0.006,0.005,0.004,0.003,0.002,0.001,0,0 +PARAM_ARML_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.003,-0.01,-0.022,-0.037,-0.055,-0.074,-0.095,-0.12,-0.136,-0.155,-0.173,-0.188,-0.2,-0.207,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.21,-0.209,-0.21,-0.208,-0.21,-0.207,-0.21,-0.205,-0.204,-0.203,-0.202,-0.201,-0.2,-0.197,-0.192,-0.185,-0.176,-0.166,-0.154,-0.141,-0.128,-0.114,-0.1,-0.086,-0.072,-0.059,-0.046,-0.034,-0.023,-0.014,-0.005,0.001,0.006,0.009,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.008,0.007,0.006,0.005,0.004,0.003,0.002,0.001,0,0 +PARAM_BODY_ANGLE_X=0 +PARAM_BODY_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.013,0.05,0.1,0.18,0.26,0.35,0.45,0.55,0.65,0.74,0.82,0.9,0.95,0.99,1,0.995,0.981,0.96,0.93,0.89,0.85,0.81,0.76,0.7,0.65,0.59,0.54,0.48,0.42,0.37,0.31,0.26,0.21,0.17,0.13,0.09,0.06,0.03,0.016,0.004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_BODY2_ANGLE_Z=-1,-0.99,-0.96,-0.92,-0.86,-0.79,-0.7,-0.61,-0.51,-0.41,-0.3,-0.19,-0.07,0.04,0.16,0.27,0.38,0.48,0.57,0.67,0.75,0.82,0.88,0.93,0.97,0.99,1,0.993,0.973,0.94,0.9,0.84,0.78,0.71,0.63,0.55,0.46,0.37,0.28,0.18,0.09,0,-0.1,-0.18,-0.27,-0.34,-0.41,-0.48,-0.54,-0.59,-0.64,-0.69,-0.73,-0.77,-0.81,-0.84,-0.87,-0.89,-0.92,-0.934,-0.951,-0.965,-0.976,-0.985,-0.992,-0.996,-0.999,-1,-0.987,-0.95,-0.89,-0.81,-0.72,-0.61,-0.48,-0.36,-0.22,-0.09,0.05,0.19,0.32,0.45,0.56,0.67,0.76,0.85,0.91,0.96,0.99,1,0.97,0.9,0.79,0.65,0.49,0.31,0.12,-0.07,-0.26,-0.43,-0.59,-0.73,-0.84,-0.93,-0.98,-1 +PARAM_BODY3_ANGLE_Z=1,0.99,0.96,0.92,0.86,0.79,0.7,0.61,0.51,0.41,0.3,0.19,0.07,-0.04,-0.16,-0.27,-0.38,-0.48,-0.57,-0.67,-0.75,-0.82,-0.88,-0.93,-0.97,-0.99,-1,-0.91,-0.66,-0.27,0.23,0.83,1.5,2.22,2.96,3.7,4.43,5.12,5.74,6.28,6.71,7,7.23,7.44,7.63,7.8,7.95,8.1,8.22,8.34,8.44,8.53,8.61,8.68,8.74,8.79,8.84,8.87,8.91,8.93,8.952,8.968,8.98,8.989,8.994,8.998,9,9,8.93,8.75,8.45,8.05,7.58,7.04,6.42,5.79,5.12,4.43,3.74,3.07,2.4,1.77,1.18,0.65,0.18,-0.23,-0.56,-0.8,-0.95,-1,-0.97,-0.9,-0.79,-0.65,-0.49,-0.31,-0.12,0.07,0.26,0.43,0.59,0.73,0.84,0.93,0.98,1 +PARAM_DM_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.11,-0.28,-0.45,-0.56,-0.61,-0.52,-0.29,-0.01,0.26,0.48,0.61,0.66,0.58,0.38,0.13,-0.11,-0.3,-0.42,-0.46,-0.39,-0.21,0.01,0.22,0.39,0.5,0.54,0.536,0.526,0.51,0.49,0.46,0.43,0.4,0.37,0.33,0.29,0.26,0.22,0.18,0.15,0.12,0.09,0.06,0.04,0.024,0.011,0.003,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +VISIBLE:ROUGH=1 +VISIBLE:PARTS_01_FACE_001=1 +VISIBLE:PARTS_01_EYE_001=1 +VISIBLE:PARTS_01_EYE_BALL_001=1 +VISIBLE:PARTS_01_BROW_001=1 +VISIBLE:PARTS_01_MOUTH_001=1 +VISIBLE:PARTS_01_NOSE_001=1 +VISIBLE:PARTS_01_EAR_001=1 +VISIBLE:PARTS_01_HAIR_FRONT_001=1 +VISIBLE:PARTS_01_HAIR_SIDE_001=1 +VISIBLE:PARTS_01_HAIR_BACK_001=1 +VISIBLE:PARTS_01_NECK=1 +VISIBLE:PARTS_01_BODY=1 +VISIBLE:PARTS_01_LEGS=1 +VISIBLE:PARTS_01_BACKGROUND=1 +VISIBLE:PARTS_01_SKETCH=0 \ No newline at end of file diff --git a/demo/model/bilibili22/motions/idle-03.mtn b/demo/model/bilibili22/motions/idle-03.mtn new file mode 100644 index 0000000..cf0d4c7 --- /dev/null +++ b/demo/model/bilibili22/motions/idle-03.mtn @@ -0,0 +1,29 @@ +# Live2D Animator Motion Data +$fps=30 + +$fadein=0 + +$fadeout=0 + +PARAM_ANGLE_X=0,0,0,0,0,0,-0.08,-0.27,-0.56,-0.92,-1.32,-1.74,-2.16,-2.57,-2.95,-3.29,-3.58,-3.8,-3.95,-4,-3.86,-3.52,-3.03,-2.43,-1.78,-1.1,-0.4,0.26,0.91,1.49,2,2.48,2.78,2.93,2.99,3.01,3.005,3,2.94,2.76,2.49,2.12,1.69,1.21,0.68,0.13,-0.43,-0.99,-1.53,-2.04,-2.52,-2.94,-3.3,-3.6,-3.82,-3.95,-4,-3.92,-3.7,-3.35,-2.89,-2.36,-1.76,-1.12,-0.46,0.21,0.86,1.45,2,2.48,2.78,2.93,3,3.01,3.005,3,2.9,2.66,2.33,1.95,1.55,1.16,0.79,0.48,0.22,0.06,0,0,0,0,0,0,0 +PARAM_ANGLE_Y=1,1,1,1,1,1,2.03,4.53,7.59,10.57,12.96,14.49,15,13.9,11.21,7.94,4.75,2.18,0.55,0,0.48,1.69,3.33,5.25,7.24,9.2,11.06,12.62,13.88,14.7,15,13.82,10.96,7.47,4.06,1.33,-0.41,-1,-0.68,0.18,1.5,3.16,5,7,9,10.84,12.5,13.82,14.68,15,13.9,11.21,7.94,4.75,2.18,0.55,0,0.28,1.03,2.19,3.64,5.25,7,8.75,10.36,11.81,12.97,13.72,14,12.9,10.21,6.94,3.75,1.18,-0.45,-1,-0.94,-0.77,-0.56,-0.3,-0.04,0.23,0.47,0.68,0.85,0.96,1,1,1,1,1,1,1 +PARAM_ANGLE_Z=0,0,0,0,0,0,-0.52,-1.86,-3.81,-6.23,-8.92,-11.72,-14.57,-17.33,-19.91,-22.24,-24.16,-25.68,-26.66,-27,-26.38,-24.74,-22.33,-19.26,-15.73,-11.77,-7.4,-2.89,1.94,6.87,12,17.64,21.61,24.16,25.71,26.54,26.91,27,26.52,25.14,23.03,20.22,16.91,13.16,9.09,4.88,0.55,-3.79,-7.96,-11.89,-15.55,-18.8,-21.62,-23.9,-25.58,-26.64,-27,-26.64,-25.63,-23.97,-21.7,-18.96,-15.66,-11.89,-7.81,-3.27,1.6,6.62,12,17.5,21.42,24,25.6,26.49,26.9,27,26.13,23.96,21.01,17.56,13.97,10.44,7.09,4.28,2.01,0.54,0,0,0,0,0,0,0 +PARAM_EYE_L_OPEN=1,0.82,0.54,0.27,0.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.03,0.11,0.22,0.35,0.48,0.61,0.74,0.84,0.93,0.98,1,0.74,0.26,0,0.26,0.74,1 +PARAM_EYE_R_OPEN=1,0.82,0.54,0.27,0.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.03,0.11,0.22,0.35,0.48,0.61,0.74,0.84,0.93,0.98,1,0.74,0.26,0,0.26,0.74,1 +PARAM_EYE_L=1,0.91,0.76,0.63,0.53,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.474,0.43,0.38,0.32,0.25,0.19,0.13,0.08,0.04,0.01,0,0.26,0.74,1,1,1,1 +PARAM_EYEK_R=1,0.91,0.76,0.63,0.53,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.49,0.474,0.43,0.38,0.32,0.25,0.19,0.13,0.08,0.04,0.01,0,0.26,0.74,1,1,1,1 +PARAM_BROW_L_Y=0,0.18,0.46,0.73,0.92,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.97,0.89,0.78,0.65,0.52,0.39,0.26,0.16,0.07,0.02,0,0,0,0,0,0,0 +PARAM_BROW_R_Y=0,0.18,0.46,0.73,0.92,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.97,0.89,0.78,0.65,0.52,0.39,0.26,0.16,0.07,0.02,0,0,0,0,0,0,0 +PARAM_MOUTH_FORM=-1,-0.64,-0.07,0.46,0.85,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.94,0.77,0.56,0.3,0.04,-0.23,-0.47,-0.68,-0.85,-0.96,-1,-1,-1,-1,-1,-1,-1 +PARAM_MOUTH_OPEN_Y=0 +PARAM_MOUTH_1=0 +PARAM_CHEEK=0,0.18,0.46,0.73,0.92,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.97,0.89,0.78,0.65,0.52,0.39,0.26,0.16,0.07,0.02,0,0,0,0,0,0,0 +PARAM_ARMR_ANGLE_Z=0,0,0,0,0,0,-0.011,-0.04,-0.07,-0.1,-0.13,-0.144,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.148,-0.143,-0.135,-0.126,-0.115,-0.103,-0.09,-0.077,-0.064,-0.051,-0.039,-0.029,-0.019,-0.011,-0.005,-0.001,0 +PARAM_ARML_ANGLE_Z=0,0,0,0,0,0,-0.011,-0.04,-0.07,-0.1,-0.13,-0.144,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.15,-0.148,-0.143,-0.135,-0.126,-0.115,-0.103,-0.09,-0.077,-0.064,-0.051,-0.039,-0.029,-0.019,-0.011,-0.005,-0.001,0 +PARAM_BODY_ANGLE_X=0,0,0,0,0,0,-0.04,-0.14,-0.28,-0.46,-0.66,-0.87,-1.08,-1.28,-1.47,-1.65,-1.79,-1.9,-1.97,-2,-1.96,-1.86,-1.7,-1.49,-1.25,-0.96,-0.66,-0.33,0,0.33,0.66,0.96,1.25,1.49,1.7,1.86,1.96,2,1.96,1.86,1.71,1.5,1.25,0.98,0.67,0.36,0.04,-0.28,-0.59,-0.88,-1.15,-1.39,-1.6,-1.77,-1.9,-1.97,-2,-1.96,-1.86,-1.71,-1.5,-1.25,-0.98,-0.67,-0.36,-0.04,0.28,0.59,0.88,1.15,1.39,1.6,1.77,1.9,1.97,2,1.97,1.91,1.8,1.68,1.53,1.37,1.2,1.02,0.85,0.68,0.53,0.38,0.25,0.15,0.07,0.02,0 +PARAM_BODY_ANGLE_Z=0,0,0,0,0,0,0.08,0.27,0.56,0.92,1.32,1.74,2.16,2.57,2.95,3.29,3.58,3.8,3.95,4,3.93,3.72,3.41,2.99,2.5,1.93,1.31,0.67,0,-0.67,-1.31,-1.93,-2.5,-2.99,-3.41,-3.72,-3.93,-4,-3.93,-3.72,-3.41,-2.99,-2.5,-1.95,-1.35,-0.72,-0.08,0.56,1.18,1.76,2.3,2.78,3.2,3.54,3.79,3.95,4,3.93,3.72,3.41,2.99,2.5,1.95,1.35,0.72,0.08,-0.56,-1.18,-1.76,-2.3,-2.78,-3.2,-3.54,-3.79,-3.95,-4,-3.95,-3.82,-3.61,-3.35,-3.06,-2.73,-2.39,-2.05,-1.7,-1.37,-1.05,-0.76,-0.51,-0.3,-0.14,-0.04,0 +PARAM_BODY2_ANGLE_Z=0,0,0,0,0,0,0.04,0.14,0.28,0.46,0.66,0.87,1.08,1.28,1.47,1.65,1.79,1.9,1.97,2,1.97,1.9,1.78,1.62,1.44,1.22,0.99,0.75,0.5,0.25,0.01,-0.22,-0.44,-0.62,-0.78,-0.9,-0.97,-1,-0.97,-0.9,-0.78,-0.62,-0.44,-0.23,-0.01,0.23,0.47,0.71,0.94,1.16,1.36,1.54,1.7,1.83,1.92,1.98,2,1.97,1.9,1.78,1.62,1.44,1.23,1.01,0.77,0.53,0.29,0.06,-0.16,-0.36,-0.54,-0.7,-0.83,-0.92,-0.98,-1,-0.987,-0.95,-0.9,-0.84,-0.76,-0.68,-0.6,-0.51,-0.42,-0.34,-0.26,-0.19,-0.13,-0.07,-0.03,-0.01,0 +PARAM_HAIR_FRONT=0,0.002,0.005,0.007,0.009,0.01,-0.06,-0.24,-0.47,-0.68,-0.85,-0.96,-1,-0.85,-0.5,-0.06,0.37,0.71,0.93,1,0.94,0.77,0.56,0.3,0.04,-0.23,-0.47,-0.68,-0.85,-0.96,-1,-0.85,-0.5,-0.06,0.37,0.71,0.93,1,0.96,0.85,0.69,0.48,0.25,0,-0.25,-0.48,-0.69,-0.85,-0.96,-1,-0.85,-0.5,-0.06,0.37,0.71,0.93,1,0.96,0.85,0.69,0.48,0.25,0,-0.25,-0.48,-0.69,-0.85,-0.96,-1,-0.85,-0.5,-0.06,0.37,0.71,0.93,1,0.97,0.89,0.78,0.65,0.52,0.39,0.26,0.16,0.07,0.02,0,0,0,0,0,0,0 +PARAM_DM_Z=0,0,0,0,0,0,0.019,0.07,0.14,0.23,0.33,0.43,0.54,0.64,0.74,0.82,0.89,0.95,0.99,1,0.982,0.93,0.85,0.75,0.62,0.48,0.33,0.17,0,-0.17,-0.33,-0.48,-0.62,-0.75,-0.85,-0.93,-0.98,-1,-0.982,-0.93,-0.85,-0.75,-0.63,-0.49,-0.34,-0.18,-0.02,0.14,0.29,0.44,0.58,0.7,0.8,0.89,0.95,0.99,1,0.982,0.93,0.85,0.75,0.63,0.49,0.34,0.18,0.02,-0.14,-0.29,-0.44,-0.58,-0.7,-0.8,-0.89,-0.95,-0.99,-1,-0.97,-0.89,-0.78,-0.65,-0.52,-0.39,-0.26,-0.16,-0.07,-0.02,0,0,0,0,0,0,0 +PARAM_fu1=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.001,0.005,0.013,0.025,0.043,0.07,0.1,0.13,0.18,0.24,0.3,0.41,0.56,0.7,0.83,0.92,0.98,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.001,0.005,0.013,0.025,0.043,0.07,0.1,0.13,0.18,0.24,0.3,0.41,0.56,0.7,0.83,0.92,0.98,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_fu2=0,0,0.003,0.008,0.016,0.029,0.046,0.07,0.1,0.14,0.18,0.24,0.3,0.41,0.55,0.69,0.82,0.92,0.98,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.003,0.008,0.016,0.029,0.046,0.07,0.1,0.14,0.18,0.24,0.3,0.41,0.55,0.69,0.82,0.92,0.98,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/demo/model/bilibili22/motions/thanking.mtn b/demo/model/bilibili22/motions/thanking.mtn new file mode 100644 index 0000000..35dbd71 --- /dev/null +++ b/demo/model/bilibili22/motions/thanking.mtn @@ -0,0 +1,46 @@ +# Live2D Animator Motion Data +$fps=30 + +$fadein=1000 + +$fadeout=1000 + +PARAM_ANGLE_X=0,-0.27,-1.03,-2.21,-3.77,-5.61,-7.69,-9.95,-12.29,-14.69,-17.1,-19.42,-21.6,-23.64,-25.44,-27.01,-28.28,-29.21,-29.8,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-29.85,-29.41,-28.71,-27.78,-26.65,-25.35,-23.86,-22.27,-20.59,-18.83,-17.06,-15.22,-13.42,-11.64,-9.91,-8.24,-6.7,-5.26,-3.95,-2.81,-1.83,-1.05,-0.48,-0.12,0 +PARAM_ANGLE_Y=0,0.03,0.14,0.32,0.58,0.93,1.36,1.89,2.51,3.24,4.06,4.99,6,7.13,8.35,9.69,11.12,12.64,14.27,16,18.67,21.2,23.59,25.71,27.47,28.83,29.69,30,27.5,23.49,19.75,17.05,16,16.011,16.04,16.1,16.17,16.26,16.37,16.49,16.63,16.78,16.94,17.11,17.29,17.48,17.67,17.87,18.07,18.27,18.47,18.68,18.88,19.08,19.28,19.47,19.65,19.83,20,20.15,20.3,20.44,20.57,20.67,20.77,20.85,20.92,20.96,20.99,21,20.55,19.79,19.23,19,18.89,18.78,18.67,18.57,18.47,18.37,18.27,18.18,18.09,18,17.91,17.82,17.74,17.66,17.58,17.5,17.42,17.35,17.28,17.21,17.14,17.08,17.01,16.95,16.9,16.84,16.78,16.73,16.68,16.63,16.58,16.54,16.49,16.45,16.41,16.38,16.34,16.31,16.27,16.24,16.22,16.19,16.16,16.14,16.12,16.101,16.083,16.067,16.053,16.04,16.03,16.021,16.013,16.007,16.003,16.001,16,16,16,16,16,16,16,16,16,16,16,15.92,15.69,15.31,14.82,14.21,13.52,12.72,11.88,10.98,10.04,9.1,8.12,7.16,6.21,5.28,4.39,3.57,2.81,2.11,1.5,0.98,0.56,0.25,0.06,0 +PARAM_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.016,0.06,0.14,0.24,0.37,0.52,0.69,0.88,1.09,1.32,1.55,1.81,2.07,2.34,2.61,2.89,3.18,3.46,3.75,4.03,4.31,4.59,4.85,5.11,5.36,5.6,5.82,6.02,6.22,6.39,6.54,6.68,6.79,6.88,6.95,6.99,7,6.52,5.72,5.18,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5.34,6.25,7.55,9.04,10.58,12.03,13.26,14.2,14.79,15,14.92,14.71,14.36,13.89,13.32,12.67,11.93,11.14,10.3,9.41,8.53,7.61,6.71,5.82,4.95,4.12,3.35,2.63,1.98,1.4,0.92,0.53,0.24,0.06,0 +PARAM_EYE_L_OPEN=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.93,0.75,0.53,0.32,0.15,0.04,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.82,0.54,0.27,0.08,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +PARAM_EYE_R_OPEN=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.93,0.75,0.53,0.32,0.15,0.04,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.82,0.54,0.27,0.08,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +PARAM_EYE_L=0,0.009,0.03,0.07,0.13,0.19,0.26,0.33,0.41,0.49,0.57,0.65,0.72,0.79,0.85,0.9,0.94,0.97,0.993,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.03,0.12,0.25,0.4,0.56,0.7,0.83,0.92,0.98,1,1,1,1,1,1,0.991,0.97,0.93,0.88,0.82,0.76,0.69,0.62,0.55,0.47,0.4,0.33,0.26,0.2,0.14,0.09,0.06,0.03,0.007,0 +PARAM_EYEK_R=0,0.009,0.03,0.07,0.13,0.19,0.26,0.33,0.41,0.49,0.57,0.65,0.72,0.79,0.85,0.9,0.94,0.97,0.993,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.03,0.12,0.25,0.4,0.56,0.7,0.83,0.92,0.98,1,1,1,1,1,1,0.991,0.97,0.93,0.88,0.82,0.76,0.69,0.62,0.55,0.47,0.4,0.33,0.26,0.2,0.14,0.09,0.06,0.03,0.007,0 +PARAM_EYE_BALL_X=0 +PARAM_EYE_BALL_Y=0 +PARAM_EYEDEFORM=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.62,0.82,0.96,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_MOUTH_OPEN_Y=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.97,0.88,0.75,0.6,0.44,0.3,0.17,0.08,0.02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_MOUTH_1=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.76,0.36,0.09,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_CHEEK=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.997,0.989,0.977,0.96,0.94,0.92,0.89,0.86,0.82,0.79,0.75,0.71,0.67,0.63,0.59,0.55,0.51,0.46,0.42,0.38,0.34,0.3,0.26,0.22,0.19,0.16,0.13,0.1,0.07,0.05,0.034,0.02,0.009,0.002,0 +PARAM_ARMR_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.24,-0.64,-0.91,-1,-0.91,-0.76,-0.65,-0.62,-0.71,-0.86,-0.97,-1,-0.89,-0.71,-0.59,-0.55,-0.66,-0.84,-0.96,-1,-0.91,-0.76,-0.65,-0.62,-0.71,-0.86,-0.97,-1,-0.89,-0.71,-0.59,-0.55,-0.66,-0.84,-0.96,-1,-0.91,-0.76,-0.65,-0.62,-0.71,-0.86,-0.97,-1,-0.89,-0.71,-0.59,-0.55,-0.66,-0.84,-0.96,-1,-1,-1,-1,-1,-1,-0.97,-0.88,-0.75,-0.6,-0.44,-0.3,-0.17,-0.08,-0.02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_ARML_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.24,-0.64,-0.91,-1,-0.91,-0.76,-0.65,-0.62,-0.71,-0.86,-0.97,-1,-0.89,-0.71,-0.59,-0.55,-0.66,-0.84,-0.96,-1,-0.91,-0.76,-0.65,-0.62,-0.71,-0.86,-0.97,-1,-0.89,-0.71,-0.59,-0.55,-0.66,-0.84,-0.96,-1,-0.91,-0.76,-0.65,-0.62,-0.71,-0.86,-0.97,-1,-0.89,-0.71,-0.59,-0.55,-0.66,-0.84,-0.96,-1,-1,-1,-1,-1,-1,-0.97,-0.88,-0.75,-0.6,-0.44,-0.3,-0.17,-0.08,-0.02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_BODY_ANGLE_X=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.42,-6.39,-9.11,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-9.66,-8.75,-7.45,-5.96,-4.42,-2.97,-1.74,-0.8,-0.21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_BODY_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.18,-5.75,-8.2,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-8.69,-7.88,-6.71,-5.37,-3.97,-2.68,-1.57,-0.72,-0.19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_BODY2_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.21,-3.19,-4.56,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-4.83,-4.38,-3.73,-2.98,-2.21,-1.49,-0.87,-0.4,-0.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_BODY3_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.48,1.28,1.82,2,1.995,1.982,1.96,1.93,1.89,1.85,1.8,1.74,1.68,1.61,1.53,1.45,1.37,1.28,1.19,1.09,0.99,0.89,0.79,0.68,0.57,0.46,0.35,0.24,0.13,0.01,-0.1,-0.21,-0.32,-0.43,-0.54,-0.65,-0.75,-0.86,-0.96,-1.06,-1.15,-1.24,-1.33,-1.42,-1.49,-1.57,-1.64,-1.7,-1.76,-1.82,-1.86,-1.9,-1.94,-1.96,-1.984,-1.996,-2,-1.995,-1.979,-1.95,-1.92,-1.88,-1.83,-1.78,-1.71,-1.65,-1.58,-1.5,-1.43,-1.35,-1.26,-1.18,-1.1,-1.01,-0.93,-0.84,-0.76,-0.68,-0.6,-0.52,-0.45,-0.38,-0.31,-0.25,-0.2,-0.15,-0.11,-0.07,-0.04,-0.02,-0.005,0 +PARAM_LEGL_ANGLE_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.2,0.52,0.74,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.81,0.78,0.71,0.6,0.48,0.36,0.24,0.14,0.06,0.02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_HAIR_FRONT=0 +PARAM_DM_Z=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0.82,0.54,0.27,0.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.24,0.64,0.91,1,0.76,0.36,0.09,0,0.24,0.64,0.91,1,0.76,0.36,0.09,0,0.24,0.64,0.91,1,0.76,0.36,0.09,0,0.24,0.64,0.91,1,0.76,0.37,0.1,0.01,0.25,0.64,0.91,1,0.76,0.37,0.1,0.01,0.25,0.64,0.91,1,0.76,0.36,0.09,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +PARAM_L=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.24,0.64,0.91,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.97,0.88,0.75,0.6,0.44,0.3,0.17,0.08,0.02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +VISIBLE:ROUGH=1 +VISIBLE:PARTS_01_FACE_001=1 +VISIBLE:PARTS_01_EYE_001=1 +VISIBLE:PARTS_01_EYE_BALL_001=1 +VISIBLE:PARTS_01_BROW_001=1 +VISIBLE:PARTS_01_MOUTH_001=1 +VISIBLE:PARTS_01_NOSE_001=1 +VISIBLE:PARTS_01_EAR_001=1 +VISIBLE:PARTS_01_HAIR_FRONT_001=1 +VISIBLE:PARTS_01_HAIR_SIDE_001=1 +VISIBLE:PARTS_01_HAIR_BACK_001=1 +VISIBLE:PARTS_01_NECK=1 +VISIBLE:PARTS_01_BODY=1 +VISIBLE:PARTS_01_LEGS=1 +VISIBLE:PARTS_01_BACKGROUND=1 +VISIBLE:PARTS_01_SKETCH=0 \ No newline at end of file diff --git a/demo/model/bilibili22/motions/touch.mtn b/demo/model/bilibili22/motions/touch.mtn new file mode 100644 index 0000000..9f32238 --- /dev/null +++ b/demo/model/bilibili22/motions/touch.mtn @@ -0,0 +1,46 @@ +# Live2D Animator Motion Data +$fps=30 + +$fadein=0 + +$fadeout=0 + +PARAM_ANGLE_X=0,0.38,1.37,2.82,4.61,6.6,8.69,10.79,12.84,14.75,16.47,17.9,19.02,19.75,20,20,20,20,20,20,20,20,20,19.31,17.47,14.8,11.63,8.37,5.2,2.53,0.69,0 +PARAM_ANGLE_Y=0,-0.36,-1.31,-2.68,-4.38,-6.27,-8.25,-10.25,-12.19,-14.01,-15.65,-17,-18.07,-18.76,-19,-17.43,-14.03,-9.79,-5.39,-1.37,1.96,4.17,5,4.83,4.37,3.7,2.91,2.09,1.3,0.63,0.17,0 +PARAM_ANGLE_Z=0,0.34,1.24,2.54,4.15,5.94,7.82,9.71,11.55,13.27,14.82,16.11,17.12,17.77,18,17.68,16.92,15.85,14.54,13.08,11.47,9.78,8,6.1,4.51,3.19,2.13,1.32,0.71,0.3,0.07,0 +PARAM_EYE_L_OPEN=1,0.998,0.991,0.982,0.97,0.957,0.944,0.93,0.917,0.904,0.893,0.884,0.876,0.872,0.87,0.87,0.872,0.874,0.878,0.883,0.89,0.899,0.91,0.924,0.938,0.952,0.964,0.976,0.986,0.993,0.998,1 +PARAM_EYE_R_OPEN=1,0.981,0.93,0.86,0.77,0.67,0.57,0.46,0.36,0.26,0.18,0.11,0.05,0.01,0,0,0,0,0,0,0,0,0,0.03,0.13,0.26,0.42,0.58,0.74,0.87,0.97,1 +PARAM_EYE_L=0,0.019,0.07,0.14,0.23,0.33,0.43,0.54,0.64,0.74,0.82,0.89,0.95,0.99,1,1,1,1,1,1,1,1,1,0.97,0.87,0.74,0.58,0.42,0.26,0.13,0.03,0 +PARAM_EYEK_R=0 +PARAM_EYE_BALL_X=0,-0.009,-0.03,-0.07,-0.11,-0.16,-0.2,-0.25,-0.3,-0.35,-0.39,-0.42,-0.45,-0.464,-0.47,-0.47,-0.47,-0.47,-0.47,-0.467,-0.463,-0.458,-0.45,-0.43,-0.38,-0.32,-0.25,-0.18,-0.11,-0.05,-0.01,0 +PARAM_EYE_BALL_Y=0,0.011,0.04,0.08,0.13,0.19,0.25,0.31,0.37,0.43,0.48,0.52,0.55,0.57,0.58,0.572,0.553,0.52,0.49,0.45,0.4,0.35,0.29,0.23,0.17,0.12,0.08,0.05,0.03,0.013,0.003,0 +PARAM_EYEDEFORM=0 +PARAM_MOUTH_OPEN_Y=0,0.014,0.05,0.11,0.17,0.25,0.33,0.4,0.48,0.55,0.62,0.67,0.71,0.74,0.75,0.741,0.72,0.68,0.63,0.57,0.51,0.45,0.38,0.32,0.26,0.2,0.14,0.09,0.06,0.03,0.007,0 +PARAM_MOUTH_1=0 +PARAM_CHEEK=0 +PARAM_ARMR_ANGLE_Z=0,0.005,0.016,0.034,0.06,0.08,0.1,0.13,0.15,0.18,0.2,0.215,0.228,0.237,0.24,0.237,0.229,0.217,0.201,0.183,0.164,0.14,0.12,0.1,0.082,0.063,0.046,0.03,0.018,0.008,0.002,0 +PARAM_ARML_ANGLE_Z=0,0.002,0.006,0.013,0.021,0.03,0.039,0.049,0.058,0.066,0.074,0.081,0.086,0.089,0.09,0.089,0.086,0.081,0.075,0.069,0.062,0.054,0.046,0.038,0.031,0.024,0.017,0.011,0.007,0.003,0.001,0 +PARAM_BODY_ANGLE_X=0,0.19,0.69,1.41,2.31,3.3,4.34,5.4,6.42,7.37,8.24,8.95,9.51,9.87,10,9.997,9.96,9.87,9.7,9.45,9.09,8.61,8,7.11,6.05,4.88,3.7,2.58,1.56,0.74,0.2,0 +PARAM_BODY_ANGLE_Z=0,-0.19,-0.69,-1.41,-2.31,-3.3,-4.34,-5.4,-6.42,-7.37,-8.24,-8.95,-9.51,-9.87,-10,-9.87,-9.54,-9.02,-8.38,-7.64,-6.84,-5.98,-5.12,-4.24,-3.41,-2.63,-1.9,-1.27,-0.74,-0.34,-0.09,0 +PARAM_BODY2_ANGLE_Z=0,-0.1,-0.34,-0.71,-1.15,-1.65,-2.17,-2.7,-3.21,-3.69,-4.12,-4.47,-4.76,-4.94,-5,-4.94,-4.77,-4.51,-4.19,-3.82,-3.42,-2.99,-2.56,-2.12,-1.71,-1.31,-0.95,-0.63,-0.37,-0.17,-0.04,0 +PARAM_BODY3_ANGLE_Z=0 +PARAM_LEGL_ANGLE_Z=0 +PARAM_DM_Z=0 +PARAM_L=0 +VISIBLE:ROUGH=1 +VISIBLE:PARTS_01_FACE_001=1 +VISIBLE:PARTS_EYE_DEFORM=1 +VISIBLE:PARTS_01_EYE_001=1 +VISIBLE:PARTS_01_EYE_BALL_001=1 +VISIBLE:PARTS_01_BROW_001=1 +VISIBLE:PARTS_01_MOUTH_001=1 +VISIBLE:PARTS_01_NOSE_001=1 +VISIBLE:PARTS_01_EAR_001=1 +VISIBLE:PARTS_01_HAIR_FRONT_001=1 +VISIBLE:PARTS_01_HAIR_SIDE_001=1 +VISIBLE:PARTS_01_HAIR_BACK_001=1 +VISIBLE:PARTS_01_NECK=1 +VISIBLE:PARTS_01_BODY=1 +VISIBLE:PARTS_01_LEGS=1 +VISIBLE:PARTS_01_BACKGROUND=1 +VISIBLE:PARTS_01_SKETCH=0 \ No newline at end of file diff --git a/demo/model/bilibili22/texture_00/closet-default-v2.png b/demo/model/bilibili22/texture_00/closet-default-v2.png new file mode 100644 index 0000000..0d00935 Binary files /dev/null and b/demo/model/bilibili22/texture_00/closet-default-v2.png differ diff --git a/demo/model/bilibili22/texture_01/cba-normal-upper.png b/demo/model/bilibili22/texture_01/cba-normal-upper.png new file mode 100644 index 0000000..0fc4e3b Binary files /dev/null and b/demo/model/bilibili22/texture_01/cba-normal-upper.png differ diff --git a/demo/model/bilibili22/texture_01/cba-super-upper.png b/demo/model/bilibili22/texture_01/cba-super-upper.png new file mode 100644 index 0000000..b4d672d Binary files /dev/null and b/demo/model/bilibili22/texture_01/cba-super-upper.png differ diff --git a/demo/model/bilibili22/texture_01/default-upper.png b/demo/model/bilibili22/texture_01/default-upper.png new file mode 100644 index 0000000..5cf11c6 Binary files /dev/null and b/demo/model/bilibili22/texture_01/default-upper.png differ diff --git a/demo/model/bilibili22/texture_01/newyear-upper.png b/demo/model/bilibili22/texture_01/newyear-upper.png new file mode 100644 index 0000000..7c824d4 Binary files /dev/null and b/demo/model/bilibili22/texture_01/newyear-upper.png differ diff --git a/demo/model/bilibili22/texture_01/school2017-upper.png b/demo/model/bilibili22/texture_01/school2017-upper.png new file mode 100644 index 0000000..bc0886c Binary files /dev/null and b/demo/model/bilibili22/texture_01/school2017-upper.png differ diff --git a/demo/model/bilibili22/texture_01/spring-2018-upper.png b/demo/model/bilibili22/texture_01/spring-2018-upper.png new file mode 100644 index 0000000..b712d05 Binary files /dev/null and b/demo/model/bilibili22/texture_01/spring-2018-upper.png differ diff --git a/demo/model/bilibili22/texture_01/summer2017-high-upper.png b/demo/model/bilibili22/texture_01/summer2017-high-upper.png new file mode 100644 index 0000000..18c710d Binary files /dev/null and b/demo/model/bilibili22/texture_01/summer2017-high-upper.png differ diff --git a/demo/model/bilibili22/texture_01/summer2017-low-upper.png b/demo/model/bilibili22/texture_01/summer2017-low-upper.png new file mode 100644 index 0000000..9f94cc2 Binary files /dev/null and b/demo/model/bilibili22/texture_01/summer2017-low-upper.png differ diff --git a/demo/model/bilibili22/texture_01/tomo-high-upper.png b/demo/model/bilibili22/texture_01/tomo-high-upper.png new file mode 100644 index 0000000..73b420d Binary files /dev/null and b/demo/model/bilibili22/texture_01/tomo-high-upper.png differ diff --git a/demo/model/bilibili22/texture_01/tomo-low-upper.png b/demo/model/bilibili22/texture_01/tomo-low-upper.png new file mode 100644 index 0000000..9314036 Binary files /dev/null and b/demo/model/bilibili22/texture_01/tomo-low-upper.png differ diff --git a/demo/model/bilibili22/texture_01/valley2017-upper.png b/demo/model/bilibili22/texture_01/valley2017-upper.png new file mode 100644 index 0000000..47ff9b4 Binary files /dev/null and b/demo/model/bilibili22/texture_01/valley2017-upper.png differ diff --git a/demo/model/bilibili22/texture_01/vdays-upper.png b/demo/model/bilibili22/texture_01/vdays-upper.png new file mode 100644 index 0000000..18f2937 Binary files /dev/null and b/demo/model/bilibili22/texture_01/vdays-upper.png differ diff --git a/demo/model/bilibili22/texture_01/xmas-upper.png b/demo/model/bilibili22/texture_01/xmas-upper.png new file mode 100644 index 0000000..e4d8139 Binary files /dev/null and b/demo/model/bilibili22/texture_01/xmas-upper.png differ diff --git a/demo/model/bilibili22/texture_02/cba-normal-lower.png b/demo/model/bilibili22/texture_02/cba-normal-lower.png new file mode 100644 index 0000000..94524a9 Binary files /dev/null and b/demo/model/bilibili22/texture_02/cba-normal-lower.png differ diff --git a/demo/model/bilibili22/texture_02/cba-super-lower.png b/demo/model/bilibili22/texture_02/cba-super-lower.png new file mode 100644 index 0000000..346f9e1 Binary files /dev/null and b/demo/model/bilibili22/texture_02/cba-super-lower.png differ diff --git a/demo/model/bilibili22/texture_02/default-lower.png b/demo/model/bilibili22/texture_02/default-lower.png new file mode 100644 index 0000000..1786e4a Binary files /dev/null and b/demo/model/bilibili22/texture_02/default-lower.png differ diff --git a/demo/model/bilibili22/texture_02/newyear-lower.png b/demo/model/bilibili22/texture_02/newyear-lower.png new file mode 100644 index 0000000..7e0cb8a Binary files /dev/null and b/demo/model/bilibili22/texture_02/newyear-lower.png differ diff --git a/demo/model/bilibili22/texture_02/school2017-lower.png b/demo/model/bilibili22/texture_02/school2017-lower.png new file mode 100644 index 0000000..678043d Binary files /dev/null and b/demo/model/bilibili22/texture_02/school2017-lower.png differ diff --git a/demo/model/bilibili22/texture_02/spring-2018-lower.png b/demo/model/bilibili22/texture_02/spring-2018-lower.png new file mode 100644 index 0000000..0bdcbba Binary files /dev/null and b/demo/model/bilibili22/texture_02/spring-2018-lower.png differ diff --git a/demo/model/bilibili22/texture_02/summer2017-high-lower.png b/demo/model/bilibili22/texture_02/summer2017-high-lower.png new file mode 100644 index 0000000..ea9b525 Binary files /dev/null and b/demo/model/bilibili22/texture_02/summer2017-high-lower.png differ diff --git a/demo/model/bilibili22/texture_02/summer2017-low-lower.png b/demo/model/bilibili22/texture_02/summer2017-low-lower.png new file mode 100644 index 0000000..053a38e Binary files /dev/null and b/demo/model/bilibili22/texture_02/summer2017-low-lower.png differ diff --git a/demo/model/bilibili22/texture_02/tomo-high-lower.png b/demo/model/bilibili22/texture_02/tomo-high-lower.png new file mode 100644 index 0000000..ae956b5 Binary files /dev/null and b/demo/model/bilibili22/texture_02/tomo-high-lower.png differ diff --git a/demo/model/bilibili22/texture_02/tomo-low-lower.png b/demo/model/bilibili22/texture_02/tomo-low-lower.png new file mode 100644 index 0000000..c07ca44 Binary files /dev/null and b/demo/model/bilibili22/texture_02/tomo-low-lower.png differ diff --git a/demo/model/bilibili22/texture_02/valley2017-lower.png b/demo/model/bilibili22/texture_02/valley2017-lower.png new file mode 100644 index 0000000..61df229 Binary files /dev/null and b/demo/model/bilibili22/texture_02/valley2017-lower.png differ diff --git a/demo/model/bilibili22/texture_02/vdays-lower.png b/demo/model/bilibili22/texture_02/vdays-lower.png new file mode 100644 index 0000000..0c779a4 Binary files /dev/null and b/demo/model/bilibili22/texture_02/vdays-lower.png differ diff --git a/demo/model/bilibili22/texture_02/xmas-lower.png b/demo/model/bilibili22/texture_02/xmas-lower.png new file mode 100644 index 0000000..782f30a Binary files /dev/null and b/demo/model/bilibili22/texture_02/xmas-lower.png differ diff --git a/demo/model/bilibili22/texture_03/cba-hat.png b/demo/model/bilibili22/texture_03/cba-hat.png new file mode 100644 index 0000000..dccb8e8 Binary files /dev/null and b/demo/model/bilibili22/texture_03/cba-hat.png differ diff --git a/demo/model/bilibili22/texture_03/default-hat.png b/demo/model/bilibili22/texture_03/default-hat.png new file mode 100644 index 0000000..4ad891c Binary files /dev/null and b/demo/model/bilibili22/texture_03/default-hat.png differ diff --git a/demo/model/bilibili22/texture_03/newyear-hat.png b/demo/model/bilibili22/texture_03/newyear-hat.png new file mode 100644 index 0000000..fe8fb7d Binary files /dev/null and b/demo/model/bilibili22/texture_03/newyear-hat.png differ diff --git a/demo/model/bilibili22/texture_03/school2017-hat.png b/demo/model/bilibili22/texture_03/school2017-hat.png new file mode 100644 index 0000000..2a7eea8 Binary files /dev/null and b/demo/model/bilibili22/texture_03/school2017-hat.png differ diff --git a/demo/model/bilibili22/texture_03/spring-2018-hat.png b/demo/model/bilibili22/texture_03/spring-2018-hat.png new file mode 100644 index 0000000..c981891 Binary files /dev/null and b/demo/model/bilibili22/texture_03/spring-2018-hat.png differ diff --git a/demo/model/bilibili22/texture_03/summer2017-hat.png b/demo/model/bilibili22/texture_03/summer2017-hat.png new file mode 100644 index 0000000..3625e74 Binary files /dev/null and b/demo/model/bilibili22/texture_03/summer2017-hat.png differ diff --git a/demo/model/bilibili22/texture_03/tomo-high-hat.png b/demo/model/bilibili22/texture_03/tomo-high-hat.png new file mode 100644 index 0000000..01ee5ab Binary files /dev/null and b/demo/model/bilibili22/texture_03/tomo-high-hat.png differ diff --git a/demo/model/bilibili22/texture_03/tomo-low-hat.png b/demo/model/bilibili22/texture_03/tomo-low-hat.png new file mode 100644 index 0000000..5f3792f Binary files /dev/null and b/demo/model/bilibili22/texture_03/tomo-low-hat.png differ diff --git a/demo/model/bilibili22/texture_03/valley2017-hat.png b/demo/model/bilibili22/texture_03/valley2017-hat.png new file mode 100644 index 0000000..77bb838 Binary files /dev/null and b/demo/model/bilibili22/texture_03/valley2017-hat.png differ diff --git a/demo/model/bilibili22/texture_03/vdays-hat.png b/demo/model/bilibili22/texture_03/vdays-hat.png new file mode 100644 index 0000000..c0aca72 Binary files /dev/null and b/demo/model/bilibili22/texture_03/vdays-hat.png differ diff --git a/demo/model/bilibili22/texture_03/xmas-hat.png b/demo/model/bilibili22/texture_03/xmas-hat.png new file mode 100644 index 0000000..6892265 Binary files /dev/null and b/demo/model/bilibili22/texture_03/xmas-hat.png differ diff --git a/demo/model/bilibili22/texture_03/xmas-headwear.png b/demo/model/bilibili22/texture_03/xmas-headwear.png new file mode 100644 index 0000000..d90cd9d Binary files /dev/null and b/demo/model/bilibili22/texture_03/xmas-headwear.png differ diff --git a/demo/model/bilibili22/textures.cache b/demo/model/bilibili22/textures.cache new file mode 100644 index 0000000..11fd2c9 --- /dev/null +++ b/demo/model/bilibili22/textures.cache @@ -0,0 +1 @@ +[["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/cba-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/default-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/newyear-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/school2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/spring-2018-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/summer2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/tomo-high-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/tomo-low-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/valley2017-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/vdays-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/xmas-hat.png"],["texture_00/closet-default-v2.png","texture_01/cba-normal-upper.png","texture_02/cba-normal-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/cba-super-upper.png","texture_02/cba-super-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/default-upper.png","texture_02/default-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/newyear-upper.png","texture_02/newyear-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/school2017-upper.png","texture_02/school2017-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/spring-2018-upper.png","texture_02/spring-2018-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-high-upper.png","texture_02/summer2017-high-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/summer2017-low-upper.png","texture_02/summer2017-low-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/tomo-high-upper.png","texture_02/tomo-high-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/tomo-low-upper.png","texture_02/tomo-low-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/valley2017-upper.png","texture_02/valley2017-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/vdays-upper.png","texture_02/vdays-lower.png","texture_03/xmas-headwear.png"],["texture_00/closet-default-v2.png","texture_01/xmas-upper.png","texture_02/xmas-lower.png","texture_03/xmas-headwear.png"]] \ No newline at end of file diff --git a/demo/model/bilibili22/textures_order.json b/demo/model/bilibili22/textures_order.json new file mode 100644 index 0000000..6b672d5 --- /dev/null +++ b/demo/model/bilibili22/textures_order.json @@ -0,0 +1,5 @@ +[ + ["texture_00"], + ["texture_01","texture_02"], + ["texture_03"] +] \ No newline at end of file diff --git a/demo/model/model_list.json b/demo/model/model_list.json new file mode 100644 index 0000000..7905760 --- /dev/null +++ b/demo/model/model_list.json @@ -0,0 +1,9 @@ +{ + "models": [ + "bilibili22" + ], + "messages": [ + "来自 Potion Maker 的 Pio 酱 ~", + "来自 Bilibili Live 的 22 哦 ~" + ] +} diff --git a/src/index.js b/src/index.js index b1f45f6..91fcca7 100755 --- a/src/index.js +++ b/src/index.js @@ -2,9 +2,10 @@ import Model from "./model.js"; import showMessage from "./message.js"; import randomSelection from "./utils.js"; import tools from "./tools.js"; +import LocalModel from "./localModel.js"; function loadWidget(config) { - const model = new Model(config); + const model = config.isLocalModel ? new LocalModel(config) : new Model(config); localStorage.removeItem("waifu-display"); sessionStorage.removeItem("waifu-text"); document.body.insertAdjacentHTML("beforeend", `
@@ -131,7 +132,7 @@ function loadWidget(config) { modelTexturesId = localStorage.getItem("modelTexturesId"); if (modelId === null) { // 首次访问加载 指定模型 的 指定材质 - modelId = 1; // 模型 ID + modelId = 0; // 模型 ID modelTexturesId = 53; // 材质 ID } model.loadModel(modelId, modelTexturesId); diff --git a/src/localModel.js b/src/localModel.js new file mode 100644 index 0000000..b0ec559 --- /dev/null +++ b/src/localModel.js @@ -0,0 +1,90 @@ +import showMessage from "./message.js"; +import randomSelection, { loadJsonFile } from "./utils.js"; + +class LocalModel { + constructor(config) { + // modelListPath: 模型列表 json 文件路径(可不填,就是约定 modelsPath 下的 model_list.json);modelsPath:模型的跟路径 + const { modelListPath, modelsPath } = config; + + if (!modelsPath) { + throw "LocalModel requires modelListPath and modelsPath!"; + } + const safeModelsPath = modelsPath.endsWith("/") ? modelsPath : modelsPath + "/"; + // 确保路径以 / 结尾 + this.modelsPath = safeModelsPath; + this.modelListPath = modelListPath ?? safeModelsPath + "model_list.json"; + } + + async loadModelList() { + try { + this.modelList = await loadJsonFile(this.modelListPath); + if (!this.modelList.models || !this.modelList.messages) { + throw "Invalid model list format!"; + } + } catch (error) { + console.error("Failed to load model list:", error); + throw "Failed to load model list!"; + } + } + + async loadModel(modelId, modelTexturesId, message) { + // 保存当前模型状态 + localStorage.setItem("modelId", modelId); + localStorage.setItem("modelTexturesId", modelTexturesId); + + // 显示消息 + showMessage(message, 4000, 10); + + // 确保模型列表已加载 + if (!this.modelList) { + await this.loadModelList(); + } + // 获取目标模型,可能是值,也可能是数组 + const target = randomSelection(this.modelList.models[modelId]); + // 加载模型 + loadlive2d("live2d", `${this.modelsPath}${target}/index.json`); + console.log(`Live2D 模型 ${target} 加载完成`); + } + + async loadRandModel() { + const modelId = localStorage.getItem("modelId"); + let modelTexturesId = localStorage.getItem("modelTexturesId"); + + if (!this.modelList) { + await this.loadModelList(); + } + + const currentModel = this.modelList.models[modelId]; + + if (Array.isArray(currentModel)) { + // 对于数组类型的模型,随机选择一个不同的贴图 + let newTextureId; + do { + newTextureId = Math.floor(Math.random() * currentModel.length); + } while (newTextureId === parseInt(modelTexturesId) && currentModel.length > 1); + + if (newTextureId === parseInt(modelTexturesId)) { + showMessage("我还没有其他衣服呢!", 4000, 10); + return; + } + + this.loadModel(modelId, newTextureId, "我的新衣服好看嘛?"); + } else { + showMessage("我还没有其他衣服呢!", 4000, 10); + } + } + + async loadOtherModel() { + let modelId = parseInt(localStorage.getItem("modelId")); + + if (!this.modelList) { + await this.loadModelList(); + } + + // 切换到下一个模型,如果到达末尾则回到开始 + const index = ++modelId >= this.modelList.models.length ? 0 : modelId; + this.loadModel(index, 0, this.modelList.messages[index]); + } +} + +export default LocalModel; diff --git a/src/utils.js b/src/utils.js index 023b78a..b8707f7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -2,4 +2,16 @@ function randomSelection(obj) { return Array.isArray(obj) ? obj[Math.floor(Math.random() * obj.length)] : obj; } +/** + * 文件加载器 + */ +export async function loadJsonFile(path) { + // 浏览器环境 + const response = await fetch(path); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + return await response.json(); +} + export default randomSelection; diff --git a/waifu-tips.js b/waifu-tips.js index 7edc656..07ef6ef 100644 --- a/waifu-tips.js +++ b/waifu-tips.js @@ -2,4 +2,4 @@ * Live2D Widget * https://github.com/stevenjoezhang/live2d-widget */ -!function(){"use strict";function e(e){return Array.isArray(e)?e[Math.floor(Math.random()*e.length)]:e}let t;function o(o,s,n){if(!o||sessionStorage.getItem("waifu-text")&&sessionStorage.getItem("waifu-text")>n)return;t&&(clearTimeout(t),t=null),o=e(o),sessionStorage.setItem("waifu-text",n);const i=document.getElementById("waifu-tips");i.innerHTML=o,i.classList.add("waifu-tips-active"),t=setTimeout((()=>{sessionStorage.removeItem("waifu-text"),i.classList.remove("waifu-tips-active")}),s)}class s{constructor(e){let{apiPath:t,cdnPath:o}=e,s=!1;if("string"==typeof o)s=!0,o.endsWith("/")||(o+="/");else{if("string"!=typeof t)throw"Invalid initWidget argument!";t.endsWith("/")||(t+="/")}this.useCDN=s,this.apiPath=t,this.cdnPath=o}async loadModelList(){const e=await fetch(`${this.cdnPath}model_list.json`);this.modelList=await e.json()}async loadModel(t,s,n){if(localStorage.setItem("modelId",t),localStorage.setItem("modelTexturesId",s),o(n,4e3,10),this.useCDN){this.modelList||await this.loadModelList();const o=e(this.modelList.models[t]);loadlive2d("live2d",`${this.cdnPath}model/${o}/index.json`)}else loadlive2d("live2d",`${this.apiPath}get/?id=${t}-${s}`),console.log(`Live2D 模型 ${t}-${s} 加载完成`)}async loadRandModel(){const t=localStorage.getItem("modelId"),s=localStorage.getItem("modelTexturesId");if(this.useCDN){this.modelList||await this.loadModelList();const s=e(this.modelList.models[t]);loadlive2d("live2d",`${this.cdnPath}model/${s}/index.json`),o("我的新衣服好看嘛?",4e3,10)}else fetch(`${this.apiPath}rand_textures/?id=${t}-${s}`).then((e=>e.json())).then((e=>{1!==e.textures.id||1!==s&&0!==s?this.loadModel(t,e.textures.id,"我的新衣服好看嘛?"):o("我还没有其他衣服呢!",4e3,10)}))}async loadOtherModel(){let e=localStorage.getItem("modelId");if(this.useCDN){this.modelList||await this.loadModelList();const t=++e>=this.modelList.models.length?0:e;this.loadModel(t,0,this.modelList.messages[t])}else fetch(`${this.apiPath}switch/?id=${e}`).then((e=>e.json())).then((e=>{this.loadModel(e.model.id,0,e.model.message)}))}}const n={hitokoto:{icon:'\x3c!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e',callback:function(){fetch("https://v1.hitokoto.cn").then((e=>e.json())).then((e=>{const t=`这句一言来自 「${e.from}」,是 ${e.creator} 在 hitokoto.cn 投稿的。`;o(e.hitokoto,6e3,9),setTimeout((()=>{o(t,4e3,9)}),6e3)}))}},asteroids:{icon:'\x3c!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e',callback:()=>{if(window.Asteroids)window.ASTEROIDSPLAYERS||(window.ASTEROIDSPLAYERS=[]),window.ASTEROIDSPLAYERS.push(new Asteroids);else{const e=document.createElement("script");e.src="https://fastly.jsdelivr.net/gh/stevenjoezhang/asteroids/asteroids.js",document.head.appendChild(e)}}},"switch-model":{icon:'\x3c!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e',callback:()=>{}},"switch-texture":{icon:'\x3c!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e',callback:()=>{}},photo:{icon:'\x3c!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e',callback:()=>{o("照好了嘛,是不是很可爱呢?",6e3,9),Live2D.captureName="photo.png",Live2D.captureFrame=!0}},info:{icon:'\x3c!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e',callback:()=>{open("https://github.com/stevenjoezhang/live2d-widget")}},quit:{icon:'\x3c!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e',callback:()=>{localStorage.setItem("waifu-display",Date.now()),o("愿你有一天能与重要的人重逢。",2e3,11),document.getElementById("waifu").style.bottom="-500px",setTimeout((()=>{document.getElementById("waifu").style.display="none",document.getElementById("waifu-toggle").classList.add("waifu-toggle-active")}),3e3)}}};function i(t){const i=new s(t);function c(t){let s,n=!1,i=t.message.default;window.addEventListener("mousemove",(()=>n=!0)),window.addEventListener("keydown",(()=>n=!0)),setInterval((()=>{n?(n=!1,clearInterval(s),s=null):s||(s=setInterval((()=>{o(i,6e3,9)}),2e4))}),1e3),o(function(e){if("/"===location.pathname)for(let{hour:t,text:o}of e){const e=new Date,s=t.split("-")[0],n=t.split("-")[1]||s;if(s<=e.getHours()&&e.getHours()<=n)return o}const t=`欢迎阅读「${document.title.split(" - ")[0]}」`;let o;if(""!==document.referrer){const e=new URL(document.referrer),s=e.hostname.split(".")[1],n={baidu:"百度",so:"360搜索",google:"谷歌搜索"};return location.hostname===e.hostname?t:(o=s in n?n[s]:e.hostname,`Hello!来自 ${o} 的朋友
${t}`)}return t}(t.time),7e3,11),window.addEventListener("mouseover",(s=>{for(let{selector:n,text:i}of t.mouseover)if(s.target.matches(n))return i=e(i),i=i.replace("{text}",s.target.innerText),void o(i,4e3,8)})),window.addEventListener("click",(s=>{for(let{selector:n,text:i}of t.click)if(s.target.matches(n))return i=e(i),i=i.replace("{text}",s.target.innerText),void o(i,4e3,8)})),t.seasons.forEach((({date:t,text:o})=>{const s=new Date,n=t.split("-")[0],c=t.split("-")[1]||n;n.split("/")[0]<=s.getMonth()+1&&s.getMonth()+1<=c.split("/")[0]&&n.split("/")[1]<=s.getDate()&&s.getDate()<=c.split("/")[1]&&(o=(o=e(o)).replace("{year}",s.getFullYear()),i.push(o))}));const c=()=>{};console.log("%c",c),c.toString=()=>{o(t.message.console,6e3,9)},window.addEventListener("copy",(()=>{o(t.message.copy,6e3,9)})),window.addEventListener("visibilitychange",(()=>{document.hidden||o(t.message.visibilitychange,6e3,9)}))}localStorage.removeItem("waifu-display"),sessionStorage.removeItem("waifu-text"),document.body.insertAdjacentHTML("beforeend",'
\n
\n \n
\n
'),setTimeout((()=>{document.getElementById("waifu").style.bottom=0}),0),function(){n["switch-model"].callback=()=>i.loadOtherModel(),n["switch-texture"].callback=()=>i.loadRandModel(),Array.isArray(t.tools)||(t.tools=Object.keys(n));for(let e of t.tools)if(n[e]){const{icon:t,callback:o}=n[e];document.getElementById("waifu-tool").insertAdjacentHTML("beforeend",`${t}`),document.getElementById(`waifu-tool-${e}`).addEventListener("click",o)}}(),function(){let e=localStorage.getItem("modelId"),o=localStorage.getItem("modelTexturesId");null===e&&(e=1,o=53),i.loadModel(e,o),fetch(t.waifuPath).then((e=>e.json())).then(c)}()}window.initWidget=function(e,t){"string"==typeof e&&(e={waifuPath:e,apiPath:t}),document.body.insertAdjacentHTML("beforeend",'
\n 看板娘\n
');const o=document.getElementById("waifu-toggle");o.addEventListener("click",(()=>{o.classList.remove("waifu-toggle-active"),o.getAttribute("first-time")?(i(e),o.removeAttribute("first-time")):(localStorage.removeItem("waifu-display"),document.getElementById("waifu").style.display="",setTimeout((()=>{document.getElementById("waifu").style.bottom=0}),0))})),localStorage.getItem("waifu-display")&&Date.now()-localStorage.getItem("waifu-display")<=864e5?(o.setAttribute("first-time",!0),setTimeout((()=>{o.classList.add("waifu-toggle-active")}),0)):i(e)}}(); +!function(){"use strict";function e(e){return Array.isArray(e)?e[Math.floor(Math.random()*e.length)]:e}let t;function o(o,s,i){if(!o||sessionStorage.getItem("waifu-text")&&sessionStorage.getItem("waifu-text")>i)return;t&&(clearTimeout(t),t=null),o=e(o),sessionStorage.setItem("waifu-text",i);const n=document.getElementById("waifu-tips");n.innerHTML=o,n.classList.add("waifu-tips-active"),t=setTimeout((()=>{sessionStorage.removeItem("waifu-text"),n.classList.remove("waifu-tips-active")}),s)}class s{constructor(e){let{apiPath:t,cdnPath:o}=e,s=!1;if("string"==typeof o)s=!0,o.endsWith("/")||(o+="/");else{if("string"!=typeof t)throw"Invalid initWidget argument!";t.endsWith("/")||(t+="/")}this.useCDN=s,this.apiPath=t,this.cdnPath=o}async loadModelList(){const e=await fetch(`${this.cdnPath}model_list.json`);this.modelList=await e.json()}async loadModel(t,s,i){if(localStorage.setItem("modelId",t),localStorage.setItem("modelTexturesId",s),o(i,4e3,10),this.useCDN){this.modelList||await this.loadModelList();const o=e(this.modelList.models[t]);loadlive2d("live2d",`${this.cdnPath}model/${o}/index.json`)}else loadlive2d("live2d",`${this.apiPath}get/?id=${t}-${s}`),console.log(`Live2D 模型 ${t}-${s} 加载完成`)}async loadRandModel(){const t=localStorage.getItem("modelId"),s=localStorage.getItem("modelTexturesId");if(this.useCDN){this.modelList||await this.loadModelList();const s=e(this.modelList.models[t]);loadlive2d("live2d",`${this.cdnPath}model/${s}/index.json`),o("我的新衣服好看嘛?",4e3,10)}else fetch(`${this.apiPath}rand_textures/?id=${t}-${s}`).then((e=>e.json())).then((e=>{1!==e.textures.id||1!==s&&0!==s?this.loadModel(t,e.textures.id,"我的新衣服好看嘛?"):o("我还没有其他衣服呢!",4e3,10)}))}async loadOtherModel(){let e=localStorage.getItem("modelId");if(this.useCDN){this.modelList||await this.loadModelList();const t=++e>=this.modelList.models.length?0:e;this.loadModel(t,0,this.modelList.messages[t])}else fetch(`${this.apiPath}switch/?id=${e}`).then((e=>e.json())).then((e=>{this.loadModel(e.model.id,0,e.model.message)}))}}const i={hitokoto:{icon:'\x3c!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc. --\x3e',callback:function(){fetch("https://v1.hitokoto.cn").then((e=>e.json())).then((e=>{const t=`这句一言来自 「${e.from}」,是 ${e.creator} 在 hitokoto.cn 投稿的。`;o(e.hitokoto,6e3,9),setTimeout((()=>{o(t,4e3,9)}),6e3)}))}},asteroids:{icon:'\x3c!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc. --\x3e',callback:()=>{if(window.Asteroids)window.ASTEROIDSPLAYERS||(window.ASTEROIDSPLAYERS=[]),window.ASTEROIDSPLAYERS.push(new Asteroids);else{const e=document.createElement("script");e.src="https://fastly.jsdelivr.net/gh/stevenjoezhang/asteroids/asteroids.js",document.head.appendChild(e)}}},"switch-model":{icon:'\x3c!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc. --\x3e',callback:()=>{}},"switch-texture":{icon:'\x3c!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc. --\x3e',callback:()=>{}},photo:{icon:'\x3c!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc. --\x3e',callback:()=>{o("照好了嘛,是不是很可爱呢?",6e3,9),Live2D.captureName="photo.png",Live2D.captureFrame=!0}},info:{icon:'\x3c!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc. --\x3e',callback:()=>{open("https://github.com/stevenjoezhang/live2d-widget")}},quit:{icon:'\x3c!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc. --\x3e',callback:()=>{localStorage.setItem("waifu-display",Date.now()),o("愿你有一天能与重要的人重逢。",2e3,11),document.getElementById("waifu").style.bottom="-500px",setTimeout((()=>{document.getElementById("waifu").style.display="none",document.getElementById("waifu-toggle").classList.add("waifu-toggle-active")}),3e3)}}};class n{constructor(e){const{modelListPath:t,modelsPath:o}=e;if(!o)throw"LocalModel requires modelListPath and modelsPath!";const s=o.endsWith("/")?o:o+"/";this.modelsPath=s,this.modelListPath=t??s+"model_list.json"}async loadModelList(){try{if(this.modelList=await async function(e){const t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}(this.modelListPath),!this.modelList.models||!this.modelList.messages)throw"Invalid model list format!"}catch(e){throw console.error("Failed to load model list:",e),"Failed to load model list!"}}async loadModel(t,s,i){localStorage.setItem("modelId",t),localStorage.setItem("modelTexturesId",s),o(i,4e3,10),this.modelList||await this.loadModelList();const n=e(this.modelList.models[t]);loadlive2d("live2d",`${this.modelsPath}${n}/index.json`),console.log(`Live2D 模型 ${n} 加载完成`)}async loadRandModel(){const e=localStorage.getItem("modelId");let t=localStorage.getItem("modelTexturesId");this.modelList||await this.loadModelList();const s=this.modelList.models[e];if(Array.isArray(s)){let i;do{i=Math.floor(Math.random()*s.length)}while(i===parseInt(t)&&s.length>1);if(i===parseInt(t))return void o("我还没有其他衣服呢!",4e3,10);this.loadModel(e,i,"我的新衣服好看嘛?")}else o("我还没有其他衣服呢!",4e3,10)}async loadOtherModel(){let e=parseInt(localStorage.getItem("modelId"));this.modelList||await this.loadModelList();const t=++e>=this.modelList.models.length?0:e;this.loadModel(t,0,this.modelList.messages[t])}}function a(t){const a=t.isLocalModel?new n(t):new s(t);function l(t){let s,i,n=!1,a=t.message.default;window.addEventListener("mousemove",(()=>n=!0)),window.addEventListener("keydown",(()=>n=!0)),setInterval((()=>{n?(n=!1,clearInterval(s),s=null):s||(s=setInterval((()=>{o(a,6e3,9)}),2e4))}),1e3),o(function(e){if("/"===location.pathname)for(let{hour:t,text:o}of e){const e=new Date,s=t.split("-")[0],i=t.split("-")[1]||s;if(s<=e.getHours()&&e.getHours()<=i)return o}const t=`欢迎阅读「${document.title.split(" - ")[0]}」`;let o;if(""!==document.referrer){const e=new URL(document.referrer),s=e.hostname.split(".")[1],i={baidu:"百度",so:"360搜索",google:"谷歌搜索"};return location.hostname===e.hostname?t:(o=s in i?i[s]:e.hostname,`Hello!来自 ${o} 的朋友
${t}`)}return t}(t.time),7e3,11),window.addEventListener("mouseover",(s=>{for(let{selector:n,text:a}of t.mouseover)if(s.target.closest(n)){if(i===n)return;return i=n,a=e(a),a=a.replace("{text}",s.target.innerText),void o(a,4e3,8)}})),window.addEventListener("click",(s=>{for(let{selector:i,text:n}of t.click)if(s.target.closest(i))return n=e(n),n=n.replace("{text}",s.target.innerText),void o(n,4e3,8)})),t.seasons.forEach((({date:t,text:o})=>{const s=new Date,i=t.split("-")[0],n=t.split("-")[1]||i;i.split("/")[0]<=s.getMonth()+1&&s.getMonth()+1<=n.split("/")[0]&&i.split("/")[1]<=s.getDate()&&s.getDate()<=n.split("/")[1]&&(o=(o=e(o)).replace("{year}",s.getFullYear()),a.push(o))}));const l=()=>{};console.log("%c",l),l.toString=()=>{o(t.message.console,6e3,9)},window.addEventListener("copy",(()=>{o(t.message.copy,6e3,9)})),window.addEventListener("visibilitychange",(()=>{document.hidden||o(t.message.visibilitychange,6e3,9)}))}localStorage.removeItem("waifu-display"),sessionStorage.removeItem("waifu-text"),document.body.insertAdjacentHTML("beforeend",'
\n
\n \n
\n
'),setTimeout((()=>{document.getElementById("waifu").style.bottom=0}),0),function(){i["switch-model"].callback=()=>a.loadOtherModel(),i["switch-texture"].callback=()=>a.loadRandModel(),Array.isArray(t.tools)||(t.tools=Object.keys(i));for(let e of t.tools)if(i[e]){const{icon:t,callback:o}=i[e];document.getElementById("waifu-tool").insertAdjacentHTML("beforeend",`${t}`),document.getElementById(`waifu-tool-${e}`).addEventListener("click",o)}}(),function(){let e=localStorage.getItem("modelId"),o=localStorage.getItem("modelTexturesId");null===e&&(e=0,o=53),a.loadModel(e,o),fetch(t.waifuPath).then((e=>e.json())).then(l)}()}window.initWidget=function(e,t){"string"==typeof e&&(e={waifuPath:e,apiPath:t}),document.body.insertAdjacentHTML("beforeend",'
\n 看板娘\n
');const o=document.getElementById("waifu-toggle");o.addEventListener("click",(()=>{o.classList.remove("waifu-toggle-active"),o.getAttribute("first-time")?(a(e),o.removeAttribute("first-time")):(localStorage.removeItem("waifu-display"),document.getElementById("waifu").style.display="",setTimeout((()=>{document.getElementById("waifu").style.bottom=0}),0))})),localStorage.getItem("waifu-display")&&Date.now()-localStorage.getItem("waifu-display")<=864e5?(o.setAttribute("first-time",!0),setTimeout((()=>{o.classList.add("waifu-toggle-active")}),0)):a(e)}}();