diff --git a/Assets/VRM/Editor/Format/VRMEditorExporter.cs b/Assets/VRM/Editor/Format/VRMEditorExporter.cs index ce0187b24..74bc3a710 100644 --- a/Assets/VRM/Editor/Format/VRMEditorExporter.cs +++ b/Assets/VRM/Editor/Format/VRMEditorExporter.cs @@ -28,7 +28,8 @@ namespace VRM { foreach (var x in destroy) { - Debug.LogFormat("destroy: {0}", x.name); + // x.name がエラーを引き起こす場合がある + // Debug.LogFormat("destroy: {0}", x.name); GameObject.DestroyImmediate(x); } } @@ -54,7 +55,7 @@ namespace VRM { continue; } - + if (removeUnknown && clip.Preset == BlendShapePreset.Unknown) { continue; diff --git a/Assets/VRM/Runtime/SpringBone/VRMSpringUtility.cs b/Assets/VRM/Runtime/SpringBone/VRMSpringUtility.cs index 31bba0a94..634d43ebe 100644 --- a/Assets/VRM/Runtime/SpringBone/VRMSpringUtility.cs +++ b/Assets/VRM/Runtime/SpringBone/VRMSpringUtility.cs @@ -145,7 +145,7 @@ namespace VRM foreach (var boneGroup in secondaryAnimation.boneGroups) { var vrmBoneGroup = secondary.gameObject.AddComponent(); - if (tryGetNode(boneGroup.center, out var node)) + if (boneGroup.center != -1 && tryGetNode(boneGroup.center, out var node)) { vrmBoneGroup.m_center = node; } diff --git a/Assets/VRM/Tests/VRMLookAtTests.cs b/Assets/VRM/Tests/VRMLookAtTests.cs index 95c197326..a9a07b4a3 100644 --- a/Assets/VRM/Tests/VRMLookAtTests.cs +++ b/Assets/VRM/Tests/VRMLookAtTests.cs @@ -1,4 +1,5 @@ +using System; using System.IO; using NUnit.Framework; using UniGLTF; @@ -32,11 +33,10 @@ namespace VRM var fp = go.GetComponent(); GameObject.DestroyImmediate(go.GetComponent()); var lookAt = go.AddComponent(); - bytes = VRMEditorExporter.Export(go, null, new VRMExportSettings - { - PoseFreeze = true, - }); - } + var settings = (VRMExportSettings)ScriptableObject.CreateInstance(); + settings.PoseFreeze = true; + bytes = VRMEditorExporter.Export(go, null, settings); + } using (var data2 = new GlbLowLevelParser(AliciaPath, bytes).Parse()) using (var loader2 = new VRMImporterContext(new VRMData(data2))) @@ -61,10 +61,9 @@ namespace VRM var fp = go.GetComponent(); var lookAt = go.GetComponent(); horizontalInner = lookAt.HorizontalInner; - bytes = VRMEditorExporter.Export(go, null, new VRMExportSettings - { - PoseFreeze = true, - }); + var settings = ScriptableObject.CreateInstance(); + settings.PoseFreeze = true; + bytes = VRMEditorExporter.Export(go, null, settings); } using (var data2 = new GlbLowLevelParser(AliciaPath, bytes).Parse()) @@ -95,10 +94,9 @@ namespace VRM var fp = go.GetComponent(); var lookAt = go.GetComponent(); horizontalInner = lookAt.HorizontalInner; - bytes = VRMEditorExporter.Export(go, null, new VRMExportSettings - { - PoseFreeze = false, - }); + var settings = (VRMExportSettings)ScriptableObject.CreateInstance(); + settings.PoseFreeze = false; + bytes = VRMEditorExporter.Export(go, null, settings); } using (var data2 = new GlbLowLevelParser(AliciaPath, bytes).Parse())