diff --git a/CHANGELOG.md b/CHANGELOG.md index d02f52c..9fbbb74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ 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.6.1] - 2023-03-10 + +### Added + +* Add function to validate MOC3 files. + + ## [4-r.6] - 2023-02-21 ### Added @@ -148,6 +155,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Reformat code using Prettier and ESLint. +[4-r.6.1]: https://github.com/Live2D/CubismWebFramework/compare/4-r.6...4-r.6.1 [4-r.6]: https://github.com/Live2D/CubismWebFramework/compare/4-r.5...4-r.6 [4-r.5]: https://github.com/Live2D/CubismWebFramework/compare/4-r.5-beta.5...4-r.5 [4-r.5-beta.5]: https://github.com/Live2D/CubismWebFramework/compare/4-r.5-beta.4...4-r.5-beta.5 diff --git a/src/model/cubismmoc.ts b/src/model/cubismmoc.ts index 17f3dff..e86833c 100644 --- a/src/model/cubismmoc.ts +++ b/src/model/cubismmoc.ts @@ -110,6 +110,15 @@ export class CubismMoc { return this._mocVersion; } + /** + * .moc3 の整合性を検証する + */ + public static hasMocConsistency(mocBytes: ArrayBuffer): boolean { + const hasMocConsistency = + Live2DCubismCore.Moc.prototype.hasMocConsistency(mocBytes); + return hasMocConsistency === 1 ? true : false; + } + _moc: Live2DCubismCore.Moc; // Mocデータ _modelCount: number; // Mocデータから作られたモデルの個数 _mocVersion: number; // 読み込んだモデルの.moc3 Version