From 775d2b9371b89607d9502d9d90873d149fc79dd5 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 11 May 2024 21:55:41 +0900 Subject: [PATCH 1/4] feat(utils): IsFinite --- Internal/Utils/Utils.Float.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Internal/Utils/Utils.Float.cs b/Internal/Utils/Utils.Float.cs index 7e4096a6f..7a4e63b0c 100644 --- a/Internal/Utils/Utils.Float.cs +++ b/Internal/Utils/Utils.Float.cs @@ -89,5 +89,7 @@ public static float PreviousFloat(float x) public static int SingleToInt32Bits(float value) => BitConverter.ToInt32(BitConverter.GetBytes(value), 0); public static float Int32BitsToSingle(int value) => BitConverter.ToSingle(BitConverter.GetBytes(value), 0); #endif + + public static bool IsFinite(float x) => !float.IsNaN(x) && !float.IsInfinity(x); } } From b75c025cab5d38d1be17b5a6ce309dbf46b7084c Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 11 May 2024 22:01:35 +0900 Subject: [PATCH 2/4] fix: MergeSkinnedMesh without sources will cause invalid AABB error --- .../Processors/SkinnedMeshes/MergeSkinnedMeshProcessor.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Editor/Processors/SkinnedMeshes/MergeSkinnedMeshProcessor.cs b/Editor/Processors/SkinnedMeshes/MergeSkinnedMeshProcessor.cs index 7026b1998..23c225ef2 100644 --- a/Editor/Processors/SkinnedMeshes/MergeSkinnedMeshProcessor.cs +++ b/Editor/Processors/SkinnedMeshes/MergeSkinnedMeshProcessor.cs @@ -317,7 +317,12 @@ MeshInfo2[] meshInfos } } - if (newBoundMin != Vector3.positiveInfinity && newBoundMax != Vector3.negativeInfinity) + if (Utils.IsFinite(newBoundMin.x) + && Utils.IsFinite(newBoundMin.y) + && Utils.IsFinite(newBoundMin.z) + && Utils.IsFinite(newBoundMax.x) + && Utils.IsFinite(newBoundMax.y) + && Utils.IsFinite(newBoundMax.z)) { target.Bounds.SetMinMax(newBoundMin, newBoundMax); } From 05303a70348eea37cc4c77bc5013ac2694f48513 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 11 May 2024 22:09:01 +0900 Subject: [PATCH 3/4] docs(changelog): Invalid AABB error message from UnityEngine if there are no source for Merge Skinned Mesh --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e5a21fcf..f87537432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog]. ### Fixed - Some rare material swap animation can cause exception `#1067` +- Invalid AABB error message from UnityEngine if there are no source for Merge Skinned Mesh `#1068` ### Security From ee2d6ade6a6f3a4da567617cb97d9c634fec807a Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 12 May 2024 23:45:45 +0900 Subject: [PATCH 4/4] docs(changelog): Invalid AABB error message from UnityEngine if there are no source for Merge Skinned Mesh --- CHANGELOG-PRERELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 5b90c1dab..0808d9fb6 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog]. ### Removed ### Fixed +- Invalid AABB error message from UnityEngine if there are no source for Merge Skinned Mesh `#1068` ### Security