diff --git a/CHANGELOG.md b/CHANGELOG.md index bb38e3a..be8d704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,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/). -## [Unreleased] +## [4-r.4] - 2021-12-09 ### Fixed -* Fix return correct error values for out-of-index arguments in cubismjson. +* Fix useless void 0. +* Fix a warning when `SegmentType` could not be obtained when loading motion. +* Fix return correct error values for out-of-index arguments in cubismjson by [@cocor-au-lait](https://github.com/cocor-au-lait). +* Fix a bug that motions currently played do not fade out when play a motion. ## [4-r.3] - 2021-06-10 @@ -63,6 +66,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Reformat code using Prettier and ESLint. +[4-r.4]: https://github.com/Live2D/CubismWebFramework/compare/4-r.3...4-r.4 [4-r.3]: https://github.com/Live2D/CubismWebFramework/compare/4-r.3-beta.1...4-r.3 [4-r.3-beta.1]: https://github.com/Live2D/CubismWebFramework/compare/4-r.2...4-r.3-beta.1 [4-r.2]: https://github.com/Live2D/CubismWebFramework/compare/4-r.1...4-r.2 diff --git a/README.md b/README.md index 68d6819..5e1d4c4 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,14 @@ Live2D Cubism 4 Editor で出力したモデルをアプリケーションで利 ### Node.js -* 16.1.0 -* 14.17.0 -* 12.22.1 +* 17.2.0 +* 16.13.1 +* 14.18.2 +* 12.22.7 ### TypeScript -4.2.2 +4.5.2 ## 開発環境構築 @@ -132,3 +133,11 @@ JSONパーサーやログ出力などのユーティリティ機能を提供し ## 変更履歴 当リポジトリの変更履歴については [CHANGELOG.md](CHANGELOG.md) を参照ください。 + + +## コミュニティ + +ユーザー同士でCubism SDKの活用方法の提案や質問をしたい場合は、是非コミュニティをご活用ください。 + +- [Live2D 公式コミュニティ](https://creatorsforum.live2d.com/) +- [Live2D community(English)](http://community.live2d.com/) diff --git a/src/motion/acubismmotion.ts b/src/motion/acubismmotion.ts index c22c664..3afcad2 100644 --- a/src/motion/acubismmotion.ts +++ b/src/motion/acubismmotion.ts @@ -26,7 +26,6 @@ export abstract class ACubismMotion { */ public static delete(motion: ACubismMotion): void { motion.release(); - motion = void 0; motion = null; } diff --git a/src/motion/cubismmotion.ts b/src/motion/cubismmotion.ts index c420837..e690c52 100644 --- a/src/motion/cubismmotion.ts +++ b/src/motion/cubismmotion.ts @@ -11,7 +11,11 @@ import { CubismMath } from '../math/cubismmath'; import { CubismModel } from '../model/cubismmodel'; import { csmString } from '../type/csmstring'; import { csmVector } from '../type/csmvector'; -import { CSM_ASSERT, CubismLogDebug } from '../utils/cubismdebug'; +import { + CSM_ASSERT, + CubismLogDebug, + CubismLogWarning +} from '../utils/cubismdebug'; import { ACubismMotion, FinishedMotionCallback } from './acubismmotion'; import { CubismMotionCurve, @@ -783,6 +787,10 @@ export class CubismMotion extends ACubismMotion { ) { this._motionData.curves.at(curveCount).type = CubismMotionCurveTarget.CubismMotionCurveTarget_PartOpacity; + } else { + CubismLogWarning( + 'Warning : Unable to get segment type from Curve! The number of "CurveCount" may be incorrect!' + ); } this._motionData.curves.at(curveCount).id = json.getMotionCurveId( diff --git a/src/motion/cubismmotionqueueentry.ts b/src/motion/cubismmotionqueueentry.ts index c9dca2e..3fa75d5 100644 --- a/src/motion/cubismmotionqueueentry.ts +++ b/src/motion/cubismmotionqueueentry.ts @@ -215,7 +215,7 @@ export class CubismMotionQueueEntry { * @return フェードアウト開始するかどうか */ public isTriggeredFadeOut(): boolean { - return this._isTriggeredFadeOut && this._endTimeSeconds < 0.0; + return this._isTriggeredFadeOut; } /** diff --git a/src/motion/cubismmotionqueuemanager.ts b/src/motion/cubismmotionqueuemanager.ts index a5df256..2aa5565 100644 --- a/src/motion/cubismmotionqueuemanager.ts +++ b/src/motion/cubismmotionqueuemanager.ts @@ -38,7 +38,6 @@ export class CubismMotionQueueManager { for (let i = 0; i < this._motions.getSize(); ++i) { if (this._motions.at(i)) { this._motions.at(i).release(); - this._motions.set(i, void 0); this._motions.set(i, null); } } @@ -111,7 +110,6 @@ export class CubismMotionQueueManager { if (motion == null) { motionQueueEntry.release(); - motionQueueEntry = void 0; motionQueueEntry = null; ite = this._motions.erase(ite); // 削除 continue; @@ -137,7 +135,6 @@ export class CubismMotionQueueManager { public isFinishedByHandle( motionQueueEntryNumber: CubismMotionQueueEntryHandle ): boolean { - // 既にモーションがあれば終了フラグを立てる for ( let ite: iterator = this._motions.begin(); ite.notEqual(this._motions.end()); @@ -181,7 +178,6 @@ export class CubismMotionQueueManager { // ----- 終了済みの処理があれば削除する ------ motionQueueEntry.release(); - motionQueueEntry = void 0; motionQueueEntry = null; ite = this._motions.erase(ite); // 削除 } @@ -198,7 +194,6 @@ export class CubismMotionQueueManager { motionQueueEntryNumber: any ): CubismMotionQueueEntry { //------- 処理を行う ------- - // 既にモーションがあれば終了フラグを立てる for ( let ite: iterator = this._motions.begin(); ite.notEqual(this._motions.end()); @@ -262,7 +257,6 @@ export class CubismMotionQueueManager { if (motion == null) { motionQueueEntry.release(); - motionQueueEntry = void 0; motionQueueEntry = null; ite = this._motions.erase(ite); // 削除 @@ -289,7 +283,6 @@ export class CubismMotionQueueManager { // ------ 終了済みの処理があれば削除する ------ if (motionQueueEntry.isFinished()) { motionQueueEntry.release(); - motionQueueEntry = void 0; motionQueueEntry = null; ite = this._motions.erase(ite); // 削除 } else {