Skip to content

Commit 0f1bbec

Browse files
Merge pull request #75 from Live2D/develop
Update to Cubism 5 SDK for Unity R1 beta3
2 parents ce9dc3b + 08815c8 commit 0f1bbec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+20026
-506
lines changed

Assets/Live2D/Cubism/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77

8+
## [5-r.1-beta.3] - 2023-11-14
9+
10+
### Added
11+
12+
* Add `HarmonicMotion` sample scenes.
13+
14+
### Changed
15+
16+
* Change the version of the development project to `2021.3.30f1`.
17+
* Change the value of `Editor` to `AnyCPU` in the `Platform settings` of `Live2DCubismCore.bundle`.
18+
* Apple Silicon version of the Unity Editor will work without the need to change `Platform settings`.
19+
20+
### Fixed
21+
22+
* Fix an error when displaying CubismRendererInspector for uninitialized models.
23+
* Fix condition for clearing AnimationCurve when Reimporting .motion3.json.
24+
25+
826
## [5-r.1-beta.2] - 2023-09-28
927

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

334352

353+
[5-r.1-beta.3]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.2...5-r.1-beta.3
335354
[5-r.1-beta.2]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.1...5-r.1-beta.2
336355
[5-r.1-beta.1]: https://github.com/Live2D/CubismUnityComponents/compare/4-r.7...5-r.1-beta.1
337356
[4-r.7]: https://github.com/Live2D/CubismUnityComponents/compare/4-r.6.2...4-r.7

Assets/Live2D/Cubism/Editor/Inspectors/CubismRendererInspector.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88

9+
using Live2D.Cubism.Core;
910
using Live2D.Cubism.Rendering;
1011
using UnityEditor;
1112
using UnityEngine;
@@ -35,6 +36,15 @@ public override void OnInspectorGUI()
3536
return;
3637
}
3738

39+
if (!renderer.isActiveAndEnabled)
40+
{
41+
var model = renderer.FindCubismModel(true);
42+
var ctrl = model.GetComponent<CubismRenderController>();
43+
if (!ctrl.IsInitialized)
44+
{
45+
ctrl.TryInitializeRenderers();
46+
}
47+
}
3848

3949
// Show settings.
4050
EditorGUILayout.ObjectField("Mesh", renderer.Mesh, typeof(Mesh), false);

Assets/Live2D/Cubism/Framework/Json/CubismMotion3Json.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public AnimationClip ToAnimationClip(AnimationClip animationClip, bool shouldImp
246246
, bool isCallFormModelJson = false, CubismPose3Json poseJson = null)
247247
{
248248
// Clear curves.
249-
if (shouldClearAnimationCurves && (!shouldImportAsOriginalWorkflow || (isCallFormModelJson && shouldImportAsOriginalWorkflow)))
249+
if (!shouldImportAsOriginalWorkflow || (isCallFormModelJson && shouldImportAsOriginalWorkflow && shouldClearAnimationCurves))
250250
{
251251
animationClip.ClearCurves();
252252
}

Assets/Live2D/Cubism/NOTICE.ja.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44

55
# お知らせ
66

7-
## [注意事項] Apple Silicon版 Unity Editor での動作について (2023-01-26)
8-
9-
Apple Silicon版Unity Editorでの動作につきまして、macOS向けのCubism Coreを利用するには `Assets/Live2D/Cubism/Plugins/macOS` 以下にある `Live2DCubismCore.bundle` をインスペクタから操作する必要があります。
10-
手順は以下の通りとなります。
11-
12-
1. `Live2DCubismCore.bundle` を選択状態にし、インスペクタを表示する。
13-
1. `Platform settings``Editor` を選択し、`Apple Silicon` または `Any CPU` を選択する。
14-
1. Unity Editorを再起動する。
15-
16-
177
## [注意事項] Windows 11の対応状況について (2021-12-09)
188

199
Windows 11対応につきまして、Windows 11上にて成果物の動作を確認しております。

Assets/Live2D/Cubism/NOTICE.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44

55
# Notices
66

7-
## [Caution] Operation on the Apple Silicon version of Unity Editor (2023-01-26)
8-
9-
To use Cubism Core for macOS on the Apple Silicon version of the Unity Editor, you need to modify the `Live2DCubismCore.bundle` under `Assets/Live2D/Cubism/Plugins/macOS` from the inspector.
10-
The procedure is as follows:
11-
12-
1. Select `Live2DCubismCore.bundle` and display the inspector.
13-
1. Go to `Platform Settings` > `Editor` and select `Apple Silicon` or `Any CPU`.
14-
1. Restart the Unity Editor.
15-
16-
177
## [Caution] Support for Windows 11 (2021-12-09)
188

199
Regarding Windows 11 compatibility, we have confirmed that the deliverables work on Windows 11.

Assets/Live2D/Cubism/Plugins/macOS/Live2DCubismCore.bundle.meta

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Live2D/Cubism/README.ja.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ Unity Editor拡張機能は、`./Assets/Live2D/Cubism/Editor`にあります。
5454

5555
| Unity | バージョン |
5656
| --- | --- |
57-
| Latest | 2023.1.14f1 (*1) |
58-
| LTS | 2022.3.10f1 |
59-
| LTS | 2021.3.30f1 |
57+
| Latest | 2023.1.19f1 (*1) |
58+
| LTS | 2022.3.12f1 |
59+
| LTS | 2021.3.31f1 |
6060

6161
*1 ARMv7のAndroidは非対応です。
6262

@@ -87,9 +87,9 @@ https://docs.unity3d.com/ja/2018.4/Manual/CSharpCompiler.html
8787
| iOS | 16.6.1 |
8888
| iPadOS | 16.6.1 |
8989
| Ubuntu | 20.04.6 |
90-
| macOS | 13.6 |
90+
| macOS | 14.1.1 |
9191
| Windows 10 | 22H2 |
92-
| Google Chrome | 115.0.5790.171 |
92+
| Google Chrome | 119.0.6045.106 |
9393
| Chrome OS 64bit (x86_64) | 116.0.5845.210 |
9494
| Chrome OS 32bit (ARMv8) (*3) | 115.0.5790.160 |
9595

Assets/Live2D/Cubism/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ Resources like shaders and other assets are located in `./Assets/Live2D/Cubism/R
5555

5656
| Unity | Version |
5757
| --- | --- |
58-
| Latest | 2023.1.14f1 (*1) |
59-
| LTS | 2022.3.10f1 |
60-
| LTS | 2021.3.30f1 |
58+
| Latest | 2023.1.19f1 (*1) |
59+
| LTS | 2022.3.12f1 |
60+
| LTS | 2021.3.31f1 |
6161

6262
*1 ARMv7 Android is not supported.
6363

@@ -88,9 +88,10 @@ https://docs.unity3d.com/ja/2018.4/Manual/CSharpCompiler.html
8888
| iOS | 16.6.1 |
8989
| iPadOS | 16.6.1 |
9090
| Ubuntu | 20.04.6 |
91-
| macOS | 13.6 |
91+
| macOS | 14.1.1 |
9292
| Windows 10 | 22H2 |
9393
| Google Chrome | 115.0.5790.171 |
94+
| Google Chrome | 119.0.6045.106 |
9495
| Chrome OS 64bit (x86_64) | 116.0.5845.210 |
9596
| Chrome OS 32bit (ARMv8) (*3) | 115.0.5790.160 |
9697

Assets/Live2D/Cubism/Rendering/CubismRenderController.cs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,31 @@ public CubismRenderer[] Renderers
513513
[HideInInspector]
514514
public bool HasUpdateController { get; set; }
515515

516+
/// <summary>
517+
/// <see cref="IsInitialized"/>s backing field.
518+
/// </summary>
519+
private bool _isInitialized = false;
520+
521+
/// <summary>
522+
/// Is renderers initialized.
523+
/// </summary>
524+
[HideInInspector]
525+
public bool IsInitialized
526+
{
527+
get
528+
{
529+
return _isInitialized;
530+
}
531+
private set
532+
{
533+
_isInitialized = value;
534+
}
535+
}
516536

517537
/// <summary>
518538
/// Makes sure all <see cref="CubismDrawable"/>s have <see cref="CubismRenderer"/>s attached to them.
519539
/// </summary>
520-
private void TryInitializeRenderers()
540+
public void TryInitializeRenderers()
521541
{
522542
// Try get renderers.
523543
var renderers = Renderers;
@@ -530,12 +550,10 @@ private void TryInitializeRenderers()
530550
.FindCubismModel()
531551
.Drawables;
532552

533-
534553
renderers = drawables.AddComponentEach<CubismRenderer>();
535554

536555
// Store renderers.
537556
Renderers = renderers;
538-
539557
}
540558

541559
if (renderers == null)
@@ -549,12 +567,13 @@ private void TryInitializeRenderers()
549567
renderers[i].TryInitialize(this);
550568
}
551569

552-
553570
// Initialize sorting layer.
554571
// We set the backing field here directly because we pull the sorting layer directly from the renderer.
555572
_sortingLayerId = renderers[0]
556573
.MeshRenderer
557574
.sortingLayerID;
575+
576+
IsInitialized = true;
558577
}
559578

560579

Assets/Live2D/Cubism/Rendering/Resources/Live2D/Cubism/Materials/UnlitMaskedInverted.mat

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
%TAG !u! tag:unity3d.com,2011:
33
--- !u!21 &2100000
44
Material:
5-
serializedVersion: 6
5+
serializedVersion: 8
66
m_ObjectHideFlags: 0
77
m_CorrespondingSourceObject: {fileID: 0}
88
m_PrefabInstance: {fileID: 0}
99
m_PrefabAsset: {fileID: 0}
1010
m_Name: UnlitMaskedInverted
1111
m_Shader: {fileID: 4800000, guid: b6ac6b89a3f2a5d4ba21b017d47b480c, type: 3}
12-
m_ShaderKeywords: CUBISM_INVERT_ON
12+
m_ValidKeywords:
13+
- CUBISM_INVERT_ON
14+
- CUBISM_MASK_ON
15+
m_InvalidKeywords: []
1316
m_LightmapFlags: 4
1417
m_EnableInstancingVariants: 0
1518
m_DoubleSidedGI: 0
@@ -27,6 +30,7 @@ Material:
2730
m_Texture: {fileID: 0}
2831
m_Scale: {x: 1, y: 1}
2932
m_Offset: {x: 0, y: 0}
33+
m_Ints: []
3034
m_Floats:
3135
- _Cull: 0
3236
- _DstAlpha: 10
@@ -39,3 +43,6 @@ Material:
3943
m_Colors:
4044
- cubism_MaskTile: {r: 0, g: 0, b: 0, a: 0}
4145
- cubism_MaskTransform: {r: 0, g: 0, b: 0, a: 0}
46+
- cubism_MultiplyColor: {r: 1, g: 1, b: 1, a: 1}
47+
- cubism_ScreenColor: {r: 0, g: 0, b: 0, a: 1}
48+
m_BuildTextureStacks: []

0 commit comments

Comments
 (0)