Skip to content

Commit

Permalink
Update to Cubism 5 SDK for Unity R1
Browse files Browse the repository at this point in the history
  • Loading branch information
wada-at-live2d-com committed Mar 26, 2024
1 parent ff57fcd commit a9b30c1
Show file tree
Hide file tree
Showing 24 changed files with 328 additions and 264 deletions.
30 changes: 30 additions & 0 deletions Assets/Live2D/Cubism/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@ 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/).


## [5-r.1] - 2024-03-26

### Added

* Add `CubimMath` class in namespace `Live2D.Cubism.Framework.Utils`.
* Add function `ModF()` to compute floating-point remainder in `CubismMath` class.

### Changed

* Change the message to output the latest Moc version supported by the CubismCore when the `.moc3` file fails to load correctly.
* Change the version of the development project to `2021.3.36f1`.

### Deprecated

* The `ToIndex()` and `ReturnTiles()` functions of the `CubismMaskTilePool` class are not used.

### Fixed

* Fix fade calculation bug in MotionFade.
* Fix a bug in which masks were not generated correctly when using multiple render textures and displaying two or more models.
* Fix an issue where normal processing could not be performed when `CubismMaskTilePool.Subdivisions` is less than `1`.

### Removed

* Remove `CubismWebGLPluginProcessor.cs`.
* This change is due to the removal of Cubism Core built with `Emscripten 1.38.48`.
* See `CHANGELOG.md` in Core.


## [5-r.1-beta.4] - 2024-01-18

### Added
Expand Down Expand Up @@ -367,6 +396,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Fix issue where Priority value was not reset after playing motion with CubismMotionController.


[5-r.1]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.4...5-r.1
[5-r.1-beta.4]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.3...5-r.1-beta.4
[5-r.1-beta.3]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.2...5-r.1-beta.3
[5-r.1-beta.2]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.1...5-r.1-beta.2
Expand Down
3 changes: 2 additions & 1 deletion Assets/Live2D/Cubism/Core/CubismMoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static CubismMoc CreateFrom(byte[] moc3, bool shouldCheckMocConsistency =
{
if (shouldCheckMocConsistency && !HasMocConsistency(moc3))
{
Debug.LogError("This Moc3 is Invalid. This model generation process is aborted and prefab is not created.");
Debug.LogError("This Moc3 is Invalid. This model generation process is aborted and prefab is not created.\n" +
$"Please check Model's Moc version. This CubismCore supported latest Moc version is `{LatestVersion}`.");
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,15 @@ public void OnLateUpdate()
}

var playingMotions = _fadeStates[i].GetPlayingMotions();
for (int j = 0; j < playingMotions.Count && playingMotions.Count > 2;)
for (var j = playingMotions.Count - 2; j >= 0; --j)
{
var playingMotion = playingMotions[j];
if (time <= playingMotion.EndTime)
{
j++;
continue;
}

// If fade-in has been completed, delete the motion that has been played back.
_fadeStates[i].StopAnimation(j);
}
}
Expand Down
8 changes: 8 additions & 0 deletions Assets/Live2D/Cubism/Framework/Utils.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions Assets/Live2D/Cubism/Framework/Utils/CubismMath.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/


using UnityEngine;


namespace Live2D.Cubism.Framework.Utils
{
public class CubismMath : MonoBehaviour
{
/// <summary>
/// Returns the remainder of the division of two numbers.
/// If invalid dividend or divisor is passed, it returns <see cref="float.NaN"/>.
/// </summary>
/// <param name="dividend"><see cref="Mathf.Infinity"/>, <see cref="Mathf.NegativeInfinity"/> and <see cref="float.NaN"/> are not allowed.</param>
/// <param name="divisor"><see cref="float.NaN"/> and Zero is not allowed.</param>
/// <returns></returns>
public static float ModF(float dividend, float divisor)
{
if (!float.IsFinite(dividend) || Mathf.Approximately(divisor, 0)
|| float.IsNaN(dividend) || float.IsNaN(divisor))
{
Debug.LogWarning($"Invalid dividend or divisor. divided: {dividend}, divisor: {divisor} Mod() returns 'NaN'.");
return float.NaN;
}

// Calculate the remainder of the division.
return dividend % divisor;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions Assets/Live2D/Cubism/NOTICE.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,34 @@

# お知らせ

## [注意事項] Windows 11の対応状況について (2021-12-09)

Windows 11対応につきまして、Windows 11上にて成果物の動作を確認しております。
ただし、Windows 11を利用したビルドにつきましては動作を保証しておりません、ご了承ください。
対応バージョンや時期につきましては今後のリリースをもってお知らせいたします。

## [制限事項] Windows ARM64向けの対応状況について (2024-01-18)

Unity 2023.1以降にて指定可能となったWindows ARM64向けビルドにつきまして、Cubim SDK for Unityは現在対応しておりません。
対応バージョンや時期につきましては今後のリリースをもってお知らせいたします。


## [注意事項] Apple社のPrivacy Manifest Policy対応について

Apple社が対応を必要としているPrivacy Manifest Policyについて、本製品では指定されているAPI及びサードパーティ製品を使用しておりません。
もし本製品で対応が必要と判断した場合、今後のアップデートにて順次対応する予定です。
詳しくはApple社が公開しているドキュメントをご確認ください。

[Privacy updates for App Store submissions](https://developer.apple.com/news/?id=3d8a9yyh)


## [注意事項] macOS Catalina 以降での `.bundle``.dylib` の利用について

macOS Catalina 以降で `.bundle``.dylib` を利用する際、公証の確認のためオンライン環境に接続している必要があります。

詳しくは、Apple社 公式ドキュメントをご確認ください。

* [Apple社 公式ドキュメント](https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution)


## [制限事項] 実行中のマスク用テクスチャの `RenderTextureCount` の値操作について (2024-03-26)

シーン実行中に `CubismMaskTexture.RenderTextureCount` を実行開始時よりも大きい値に変更すると、マスクが正常に再生成されない不具合を確認しています。
対応バージョンや時期につきましては今後のリリースをもってお知らせいたします。
---

©Live2D
21 changes: 15 additions & 6 deletions Assets/Live2D/Cubism/NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,34 @@

# Notices

## [Caution] Support for Windows 11 (2021-12-09)

Regarding Windows 11 compatibility, we have confirmed that the deliverables work on Windows 11.
However, please note that we do not guarantee the operation of builds using Windows 11.
Supported version will be announced with a future release.

## [Restrictions] Support for Windows ARM64 (2024-01-18)

Cubism SDK for Unity currently does not support Windows ARM64 builds for Unity 2023.1 or later.
A supported version will be announced in a future release.


## [Caution] Support for Apple's Privacy Manifest Policy

This product does not use the APIs or third-party products specified in Apple's privacy manifest policy.
This will be addressed in future updates if this product requires such support.
Please check the documentation published by Apple for details.

[Privacy updates for App Store submissions](https://developer.apple.com/news/?id=3d8a9yyh)


### [Caution] About using `.bundle` and `.dylib` on macOS Catalina or later

To use `.bundle` and `.dylib` on macOS Catalina or later, you need to be connected to an online environment to verify your notarization.

For details, please check the official Apple documentation.

* [Apple Official Documentation](https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution)


### [Restrictions] Manipulation of `RenderTextureCount` value for mask textures during execution (2024-03-26)

If `CubismMaskTexture.RenderTextureCount` is changed during scene execution to a value greater than that at the start of execution, the mask will not be regenerated correctly.
A supported version will be announced in a future release.
---

©Live2D
8 changes: 8 additions & 0 deletions Assets/Live2D/Cubism/Plugins/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/).


## 2024-03-26

### Remove

* [Unity] Remove built with Emscripten 1.38.48.
* Unity 2021.2 or later uses only Core under `Assets/Live2D/Cubism/Plugins/Experimental/Emscripten/latest`.


## 2023-09-28

### Remove
Expand Down
89 changes: 0 additions & 89 deletions Assets/Live2D/Cubism/Plugins/Editor/CubismWebGLPluginProcessor.cs

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion Assets/Live2D/Cubism/Plugins/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
| Android | x86 | Android/x86 | |
| Android | x86_64 | Android/x86_64 | |
| Emscripten | | Experimental/Emscripten/latest | bitcode(upstream LLVM wasmバックエンド) |
| Emscripten | | Experimental/Emscripten/1_38_48 | bitcode(fastcompバックエンド) |
| iOS | ARM64 | iOS/xxx-iphoneos | iOSデバイス |
| iOS | x86_64 | iOS/xxx-iphonesimulator | iOS Simulator |
| Linux | x86_64 | Linux/x86_64 | |
Expand Down
1 change: 0 additions & 1 deletion Assets/Live2D/Cubism/Plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ This folder contains platform-specific library files.
| Android | x86 | Android/x86 | |
| Android | x86_64 | Android/x86_64 | |
| Emscripten | | Experimental/Emscripten/latest | bitcode(upstream LLVM wasm backend) |
| Emscripten | | Experimental/Emscripten/1_38_48 | bitcode(fastcomp backend) |
| iOS | ARM64 | iOS/xxx-iphoneos | iOS Devices |
| iOS | x86_64 | iOS/xxx-iphonesimulator | iOS Simulator |
| Linux | x86_64 | Linux/x86_64 | |
Expand Down
1 change: 0 additions & 1 deletion Assets/Live2D/Cubism/Plugins/RedistributableFiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ under the terms of the Live2D Proprietary Software License Agreement:
- Android/x86/libLive2DCubismCore.so
- Android/x86_64/libLive2DCubismCore.so
- Experimental/Emscripten/latest/Live2DCubismCore.bc
- Experimental/Emscripten/1_38_48/Live2DCubismCore.bc
- Experimental/UWP/arm/Live2DCubismCore.dll
- Experimental/UWP/arm64/Live2DCubismCore.dll
- Experimental/UWP/x64/Live2DCubismCore.dll
Expand Down
Loading

0 comments on commit a9b30c1

Please sign in to comment.