feat: 添加使用本地模型能力
5
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
6
.idea/git_toolbox_blame.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxBlameSettings">
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
</project>
|
12
.idea/live2d-widget.iml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
8
.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/live2d-widget.iml" filepath="$PROJECT_DIR$/.idea/live2d-widget.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
32
README.md
@ -26,9 +26,11 @@
|
||||
## 使用
|
||||
|
||||
如果你是小白,或者只需要最基础的功能,那么只用将这一行代码加入 html 页面的 `head` 或 `body` 中,即可加载看板娘:
|
||||
|
||||
```xml
|
||||
<script src="https://fastly.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js"></script>
|
||||
```
|
||||
|
||||
添加代码的位置取决于你的网站的构建方式。例如,如果你使用的是 [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
|
||||
<script src="https://fastly.jsdelivr.net/gh/username/live2d-widget@latest/autoload.js"></script>
|
||||
```
|
||||
|
||||
将此处的 `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
|
||||
<script src="https://example.com/path/to/live2d-widget/autoload.js"></script>
|
||||
```
|
||||
|
||||
就可以加载了。
|
||||
|
||||
## 鸣谢
|
||||
@ -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。
|
||||
|
@ -29,6 +29,6 @@
|
||||
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
|
||||
</svg>
|
||||
</a>
|
||||
<script src="../autoload.js"></script>
|
||||
<script src="./demo.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
62
demo/demo.js
Normal file
@ -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,___,ンレ|ノ
|
||||
ト-,/ |___./
|
||||
'ー' !_,.:
|
||||
`);
|
40
demo/model/bilibili22/index.json
Normal file
@ -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}
|
||||
]
|
||||
}
|
||||
}
|
BIN
demo/model/bilibili22/model.moc
Normal file
40
demo/model/bilibili22/motions/idle-01.mtn
Normal file
@ -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
|
41
demo/model/bilibili22/motions/idle-02.mtn
Normal file
@ -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
|
29
demo/model/bilibili22/motions/idle-03.mtn
Normal file
@ -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
|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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
|
46
demo/model/bilibili22/motions/thanking.mtn
Normal file
@ -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,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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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.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
|
46
demo/model/bilibili22/motions/touch.mtn
Normal file
@ -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
|
BIN
demo/model/bilibili22/texture_00/closet-default-v2.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
demo/model/bilibili22/texture_01/cba-normal-upper.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
demo/model/bilibili22/texture_01/cba-super-upper.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
demo/model/bilibili22/texture_01/default-upper.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
demo/model/bilibili22/texture_01/newyear-upper.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
demo/model/bilibili22/texture_01/school2017-upper.png
Normal file
After Width: | Height: | Size: 110 KiB |
BIN
demo/model/bilibili22/texture_01/spring-2018-upper.png
Normal file
After Width: | Height: | Size: 138 KiB |
BIN
demo/model/bilibili22/texture_01/summer2017-high-upper.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
demo/model/bilibili22/texture_01/summer2017-low-upper.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
demo/model/bilibili22/texture_01/tomo-high-upper.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
demo/model/bilibili22/texture_01/tomo-low-upper.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
demo/model/bilibili22/texture_01/valley2017-upper.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
demo/model/bilibili22/texture_01/vdays-upper.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
demo/model/bilibili22/texture_01/xmas-upper.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
demo/model/bilibili22/texture_02/cba-normal-lower.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
demo/model/bilibili22/texture_02/cba-super-lower.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
demo/model/bilibili22/texture_02/default-lower.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
demo/model/bilibili22/texture_02/newyear-lower.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
demo/model/bilibili22/texture_02/school2017-lower.png
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
demo/model/bilibili22/texture_02/spring-2018-lower.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
demo/model/bilibili22/texture_02/summer2017-high-lower.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
demo/model/bilibili22/texture_02/summer2017-low-lower.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
demo/model/bilibili22/texture_02/tomo-high-lower.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
demo/model/bilibili22/texture_02/tomo-low-lower.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
demo/model/bilibili22/texture_02/valley2017-lower.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
demo/model/bilibili22/texture_02/vdays-lower.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
demo/model/bilibili22/texture_02/xmas-lower.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
demo/model/bilibili22/texture_03/cba-hat.png
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
demo/model/bilibili22/texture_03/default-hat.png
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
demo/model/bilibili22/texture_03/newyear-hat.png
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
demo/model/bilibili22/texture_03/school2017-hat.png
Normal file
After Width: | Height: | Size: 249 KiB |
BIN
demo/model/bilibili22/texture_03/spring-2018-hat.png
Normal file
After Width: | Height: | Size: 283 KiB |
BIN
demo/model/bilibili22/texture_03/summer2017-hat.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
demo/model/bilibili22/texture_03/tomo-high-hat.png
Normal file
After Width: | Height: | Size: 210 KiB |
BIN
demo/model/bilibili22/texture_03/tomo-low-hat.png
Normal file
After Width: | Height: | Size: 172 KiB |
BIN
demo/model/bilibili22/texture_03/valley2017-hat.png
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
demo/model/bilibili22/texture_03/vdays-hat.png
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
demo/model/bilibili22/texture_03/xmas-hat.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
demo/model/bilibili22/texture_03/xmas-headwear.png
Normal file
After Width: | Height: | Size: 67 KiB |
1
demo/model/bilibili22/textures.cache
Normal file
5
demo/model/bilibili22/textures_order.json
Normal file
@ -0,0 +1,5 @@
|
||||
[
|
||||
["texture_00"],
|
||||
["texture_01","texture_02"],
|
||||
["texture_03"]
|
||||
]
|
9
demo/model/model_list.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"models": [
|
||||
"bilibili22"
|
||||
],
|
||||
"messages": [
|
||||
"来自 Potion Maker 的 Pio 酱 ~",
|
||||
"来自 Bilibili Live 的 22 哦 ~"
|
||||
]
|
||||
}
|
@ -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", `<div id="waifu">
|
||||
@ -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);
|
||||
|
90
src/localModel.js
Normal file
@ -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;
|
12
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;
|
||||
|