Skip to content

Commit

Permalink
[Beta version] Update to Cubism 4 SDK for Web R3 Beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
itoh-at-live2d-com committed May 13, 2021
1 parent 4902c91 commit dc3dcbc
Show file tree
Hide file tree
Showing 12 changed files with 451 additions and 13 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [4-r.3-beta.1] - 2021-05-13

### Added

* Add the sample to manipulate the lip-sync from a waveform on the audio file(.wav).
* Add sample voices to `Haru`.


## [4-r.2] - 2021-03-09

### Added
Expand Down Expand Up @@ -73,7 +81,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

* Fix issue with reloading model images in WebKit.


[4-r.3-beta.1]: https://github.com/Live2D/CubismWebSamples/compare/4-r.2...4-r.3-beta.1
[4-r.2]: https://github.com/Live2D/CubismWebSamples/compare/4-r.1...4-r.2
[4-r.1]: https://github.com/Live2D/CubismWebSamples/compare/4-beta.2...4-r.1
[4-beta.2]: https://github.com/Live2D/CubismWebSamples/compare/4-beta.1...4-beta.2
Expand Down
13 changes: 13 additions & 0 deletions Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## 2021-03-09

### Added
* Add funtcions for Viewer.

* `csmGetParameterKeyCounts`
* `csmGetParameterKeyValues`

### Changed

* Update Core version to `04.01.0000`.


## 2020-01-30

### Added
Expand Down
2 changes: 1 addition & 1 deletion Framework
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Cubism Web Samples is included in Live2D Cubism Components.

Cubism Web Samples は Live2D Cubism Components に含まれます。

Cubism Web Samples 包括在 Live2D Cubism Components 中。

## Cubism SDK Release License

Expand All @@ -17,13 +18,17 @@ Cubism Web Samples は Live2D Cubism Components に含まれます。

* [Cubism SDK リリースライセンス](https://www.live2d.com/ja/download/cubism-sdk/release-license/)

如果您的企业在最近一个会计年度的销售额达到或超过1000万日元,您必须得到Cubism SDK的出版授权许可(出版许可协议)。

* [Cubism SDK发行许可证](https://www.live2d.com/zh-CHS/download/cubism-sdk/release-license/)

## Live2D Open Software License

Live2D Cubism Components is available under Live2D Open Software License.

* [Live2D Open Software License](https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html)
* [Live2D Open Software 使用許諾契約書](https://www.live2d.com/eula/live2d-open-software-license-agreement_jp.html)
* [Live2D Open Software 使用授权协议](https://www.live2d.com/eula/live2d-open-software-license-agreement_cn.html)


## Live2D Proprietary Software License
Expand All @@ -32,6 +37,7 @@ Live2D Cubism Core is available under Live2D Proprietary Software License.

* [Live2D Proprietary Software License Agreement](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html)
* [Live2D Proprietary Software 使用許諾契約書](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_jp.html)
* [Live2D Proprietary Software 使用授权协议](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_cn.html)


## Free Material License
Expand All @@ -40,6 +46,7 @@ Live2D models listed below are available under Free Material License.

* [Free Material License Agreement](https://www.live2d.com/eula/live2d-free-material-license-agreement_en.html)
* [無償提供マテリアルの使用許諾契約書](https://www.live2d.com/eula/live2d-free-material-license-agreement_jp.html)
* [无偿提供素材使用授权协议](https://www.live2d.com/eula/live2d-free-material-license-agreement_cn.html)

```
Samples/Resources/Haru
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Cubism Web Samples
# \[Beta Version\] Cubism Web Samples

Live2D Cubism 4 Editor で出力したモデルを表示するアプリケーションのサンプル実装です。

Cubism Web Framework および Live2D Cubism Core と組み合わせて使用します。

**本 SDK は、 Beta バージョンとなります。先行して新機能を取り込んでいるため、不安定な挙動を示す場合がございます。安定した製品をお求めの方は、公式サイトから配布されている正式版のパッケージ又は `develop` `master` ブランチをご利用ください。**

**[Beta Version] の SDK の不具合、各種ご意見等に関しましては、 Live2D コミュニティ にてご連絡ください。直接のコードに対する指摘、修正等は、直接 Pull requests としてご投稿ください。**


## ライセンス

Expand Down Expand Up @@ -80,10 +84,10 @@ NOTE: デバック用の設定は、`.vscode/launch.json` に記述していま

### Node.js

* 15.11.0
* 14.16.0
* 12.21.0
* 10.24.0
* 15.14.0
* 14.16.1
* 12.22.1
* 10.24.1


## 動作確認環境
Expand Down
14 changes: 9 additions & 5 deletions Samples/Resources/Haru/Haru.model3.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
{"File":"motions/haru_g_m15.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5}
],
"TapBody": [
{"File":"motions/haru_g_m06.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5},
{"File":"motions/haru_g_m09.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5},
{"File":"motions/haru_g_m20.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5},
{"File":"motions/haru_g_m26.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5}
{"File":"motions/haru_g_m06.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5
,"Sound": "sounds/haru_normal_01.wav"},
{"File":"motions/haru_g_m09.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5
,"Sound": "sounds/haru_normal_02.wav"},
{"File":"motions/haru_g_m20.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5
,"Sound": "sounds/haru_normal_03.wav"},
{"File":"motions/haru_g_m26.motion3.json" ,"FadeInTime":0.5, "FadeOutTime":0.5
,"Sound": "sounds/haru_normal_04.wav"}
]
},
"UserData": "Haru.userdata3.json"
Expand All @@ -52,4 +56,4 @@
{"Name":"Head", "Id":"HitArea"},
{"Name":"Body", "Id":"HitArea2"}
]
}
}
Binary file added Samples/Resources/Haru/sounds/haru_normal_01.wav
Binary file not shown.
Binary file added Samples/Resources/Haru/sounds/haru_normal_02.wav
Binary file not shown.
Binary file added Samples/Resources/Haru/sounds/haru_normal_03.wav
Binary file not shown.
Binary file added Samples/Resources/Haru/sounds/haru_normal_04.wav
Binary file not shown.
16 changes: 15 additions & 1 deletion Samples/TypeScript/Demo/src/lappmodel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import * as LAppDefine from './lappdefine';
import { canvas, frameBuffer, gl, LAppDelegate } from './lappdelegate';
import { LAppPal } from './lapppal';
import { TextureInfo } from './lapptexturemanager';
import { LAppWavFileHandler } from './lappwavfilehandler';

enum LoadStep {
LoadAssets,
Expand Down Expand Up @@ -507,7 +508,10 @@ export class LAppModel extends CubismUserModel {

// リップシンクの設定
if (this._lipsync) {
const value = 0; // リアルタイムでリップシンクを行う場合、システムから音量を取得して、0~1の範囲で値を入力します。
let value = 0.0; // リアルタイムでリップシンクを行う場合、システムから音量を取得して、0~1の範囲で値を入力します。

this._wavFileHandler.update(deltaTimeSeconds);
value = this._wavFileHandler.getRms();

for (let i = 0; i < this._lipSyncIds.getSize(); ++i) {
this._model.addParameterValueById(this._lipSyncIds.at(i), value, 0.8);
Expand Down Expand Up @@ -583,6 +587,14 @@ export class LAppModel extends CubismUserModel {
motion.setFinishedMotionHandler(onFinishedMotionHandler);
}

//voice
const voice = this._modelSetting.getMotionSoundFileName(group, no);
if (voice.localeCompare('') != 0) {
let path = voice;
path = this._modelHomeDir + path;
this._wavFileHandler.start(path);
}

if (this._debugMode) {
LAppPal.printMessage(`[APP]start motion: [${group}_${no}`);
}
Expand Down Expand Up @@ -843,6 +855,7 @@ export class LAppModel extends CubismUserModel {
this._textureCount = 0;
this._motionCount = 0;
this._allMotionCount = 0;
this._wavFileHandler = new LAppWavFileHandler();
}

_modelSetting: ICubismModelSetting; // モデルセッティング情報
Expand Down Expand Up @@ -870,4 +883,5 @@ export class LAppModel extends CubismUserModel {
_textureCount: number; // テクスチャカウント
_motionCount: number; // モーションデータカウント
_allMotionCount: number; // モーション総数
_wavFileHandler: LAppWavFileHandler; //wavファイルハンドラ
}
Loading

0 comments on commit dc3dcbc

Please sign in to comment.