dsh-live2dwaifu 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -31
- package/docs/preview.png +0 -0
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -1,74 +1,98 @@
|
|
|
1
|
-
# dsh-
|
|
1
|
+
# dsh-live2dwaifu
|
|
2
2
|
|
|
3
|
-
把 **Live2D(Cubism 3 / 4)**
|
|
3
|
+
把 **Live2D(Cubism 3 / 4)** 模型请进 DSH 网页的右下角。她会眨眼、会呼吸、头发会被风吹,说话时嘴一张一合,心情变了眉毛跟着动。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
模型**不是内置的**——谁装谁放自己的。点卡片上的 ⚙,把模型文件夹整个选进去就行,文件留在这台机器上(`~/.dsh/dsh-live2d/models/`),一根网线都没往外走。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> 给它一个模型,它给你一个会呼吸的角落。
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
| 样子 | 说明 |
|
|
12
|
+
|---|---|
|
|
13
|
+
| 展开 | 一张小卡片,上半身,底下一条气泡装台词 |
|
|
14
|
+
| 收起 | 缩成一条,只剩名字和一个 ⌃ |
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
## 三十秒上手
|
|
14
17
|
|
|
15
18
|
```bash
|
|
16
|
-
dsh plugin --profile desktop add
|
|
19
|
+
dsh plugin --profile desktop add dsh-live2dwaifu
|
|
17
20
|
```
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
重启 DSH,右下角出现一张小卡片 → 点 ⚙ → 点「导入模型」→ 选那个装着 `.model3.json` 的文件夹 → 完事。
|
|
23
|
+
|
|
24
|
+
导入的时候浏览器会一个一个把文件搬进去,模型大点就多等几秒,进度在底下会说话。
|
|
20
25
|
|
|
21
26
|
## 放自己的模型
|
|
22
27
|
|
|
23
28
|
1. 卡片右上角 ⚙ → 「导入模型」
|
|
24
|
-
2.
|
|
25
|
-
3.
|
|
29
|
+
2. 选**整个文件夹**(里面要有 `.model3.json`、`.moc3`、贴图,最好还有 `.physics3.json`)
|
|
30
|
+
3. 读完它会自己认出哪个是模型,并切过去
|
|
31
|
+
|
|
32
|
+
想放好几个也行,列表里点「用这个」换人,「删」送走。
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
**能吃什么**:Cubism 3 / 4(`.model3.json` + `.moc3`)。
|
|
35
|
+
**吃不了什么**:Cubism 2 的老格式(`.model.json` + `.moc`)。
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
**没有动作文件也能用**:眨眼走 EyeBlink 参数组,嘴动走 LipSync / ParamMouthOpenY,头发靠 physics3.json 自带物理;表情由本插件用标准参数(`ParamEyeLSmile`、`ParamMouthForm`、`ParamBrow*`、`ParamAngle*`)现摆。
|
|
37
|
+
**没有动作文件也能活**:眨眼靠 EyeBlink 参数组,嘴动靠 `ParamMouthOpenY`,头发晃动是 `physics3.json` 自带的物理;表情是本插件拿标准参数(`ParamEyeLSmile`、`ParamMouthForm`、`ParamBrow*`、`ParamAngle*`)现摆的,一共七种:平静、开心、委屈、生气、害羞、无语、困。
|
|
31
38
|
|
|
32
|
-
##
|
|
39
|
+
## 让它说点什么
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
卡片里是个 iframe(`/dsh-live2d/viewer`)。别的插件、脚本、控制台都能指挥它:
|
|
35
42
|
|
|
36
43
|
```js
|
|
37
44
|
const frame = document.querySelector('iframe.dsh-l2d-body');
|
|
38
45
|
|
|
39
|
-
//
|
|
46
|
+
// 说话:逐字蹦出来,嘴跟着动
|
|
40
47
|
frame.contentWindow.postMessage({ type: 'dsh-live2d/say', text: '窗台那盆番茄红了。', mood: '开心' }, '*');
|
|
41
48
|
|
|
42
|
-
//
|
|
49
|
+
// 只换脸
|
|
43
50
|
frame.contentWindow.postMessage({ type: 'dsh-live2d/mood', mood: '委屈' }, '*');
|
|
44
51
|
|
|
45
52
|
// 打开模型管理
|
|
46
53
|
frame.contentWindow.postMessage({ type: 'dsh-live2d/manage' }, '*');
|
|
47
54
|
```
|
|
48
55
|
|
|
49
|
-
HTTP
|
|
56
|
+
同源的 HTTP 接口,给不服 iframe 的人:
|
|
50
57
|
|
|
51
58
|
| 方法 | 路径 | 作用 |
|
|
52
59
|
|---|---|---|
|
|
53
|
-
| GET | `/dsh-live2d/api/models` |
|
|
54
|
-
| POST | `/dsh-live2d/api/select` | `{id}`
|
|
55
|
-
| POST | `/dsh-live2d/api/import?model=<id>&path=<相对路径>` |
|
|
56
|
-
| POST | `/dsh-live2d/api/commit` | `{id,name}`
|
|
60
|
+
| GET | `/dsh-live2d/api/models` | 列出模型和当前选中的那只 |
|
|
61
|
+
| POST | `/dsh-live2d/api/select` | `{id}` 换人 |
|
|
62
|
+
| POST | `/dsh-live2d/api/import?model=<id>&path=<相对路径>` | 请求体就是文件字节 |
|
|
63
|
+
| POST | `/dsh-live2d/api/commit` | `{id,name}` 扫一遍 model3 并选中 |
|
|
57
64
|
| POST | `/dsh-live2d/api/delete` | `{id}` 删掉 |
|
|
58
65
|
|
|
59
|
-
##
|
|
66
|
+
## 东西都放哪了
|
|
60
67
|
|
|
61
68
|
```
|
|
62
69
|
~/.dsh/dsh-live2d/
|
|
63
|
-
config.json #
|
|
64
|
-
models/<id>/ #
|
|
70
|
+
config.json # 现在轮到谁上场
|
|
71
|
+
models/<id>/ # 模型文件,相对结构原样保留
|
|
65
72
|
meta.json # { name, model3 }
|
|
66
73
|
```
|
|
67
74
|
|
|
75
|
+
## 一些常见的小脾气
|
|
76
|
+
|
|
77
|
+
**右下角什么都没有?**
|
|
78
|
+
先重启一次 DSH;还不来就看 `cordis.patch.yml` 里有没有 `- id: dsh-live2dwaifu` 这一行。
|
|
79
|
+
|
|
80
|
+
**导入了却不认得?**
|
|
81
|
+
多半是文件夹选得太靠上或太靠下,`.model3.json` 就在里面那一层,选它隔壁那层。
|
|
82
|
+
|
|
83
|
+
**她只有半张脸?**
|
|
84
|
+
这个模型的画布比例跟面板不一样。面板是竖的,太宽或太扁的模型会被裁两边。
|
|
85
|
+
|
|
86
|
+
**能放动作吗?**
|
|
87
|
+
暂时不能编排 `.motion3.json`,表情是固定的七种。想要更多情绪,给它发 `mood`,等以后的版本。
|
|
88
|
+
|
|
68
89
|
## 已知限制
|
|
69
90
|
|
|
70
|
-
- 只支持 Cubism 3 / 4
|
|
71
|
-
- 面板是浮层(`shell.overlay
|
|
72
|
-
-
|
|
91
|
+
- 只支持 Cubism 3 / 4
|
|
92
|
+
- 面板是浮层(`shell.overlay`),不是聊天区分栏;会盖住右下角,能收起
|
|
93
|
+
- 七种表情,暂不支持自定义表情文件(`.exp3.json`)
|
|
94
|
+
- 内置的 Cubism Core 是 Live2D Inc. 的 Redistributable Code,随包分发,使用受其 EULA 约束
|
|
95
|
+
|
|
96
|
+
---
|
|
73
97
|
|
|
74
|
-
MIT © LFR
|
|
98
|
+
MIT © LFR · npm: [`dsh-live2dwaifu`](https://www.npmjs.com/package/dsh-live2dwaifu)
|
package/docs/preview.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-live2dwaifu",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "给 DSH 网页右下角请一个 Live2D 角色:会眨眼、会呼吸、说话时嘴动、心情变了眉毛跟着动。模型不用内置——谁装谁放自己的文件夹,文件留在这台机器上。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -29,11 +29,20 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"lib",
|
|
31
31
|
"assets",
|
|
32
|
+
"docs",
|
|
32
33
|
"icon.png",
|
|
33
34
|
"cordis.patch.yml",
|
|
34
35
|
"README.md",
|
|
35
36
|
"LICENSE"
|
|
36
37
|
],
|
|
37
38
|
"license": "MIT",
|
|
38
|
-
"icon": "./icon.png"
|
|
39
|
+
"icon": "./icon.png",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/FujiwaraReisen/dsh-live2dwaifu.git"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/FujiwaraReisen/dsh-live2dwaifu#readme",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/FujiwaraReisen/dsh-live2dwaifu/issues"
|
|
47
|
+
}
|
|
39
48
|
}
|