diff --git a/Assets/VRM/UniHumanoid/Editor/BoneMappingEditor.cs b/Assets/VRM/UniHumanoid/Editor/BoneMappingEditor.cs index 95f0db886..d94a21aa7 100644 --- a/Assets/VRM/UniHumanoid/Editor/BoneMappingEditor.cs +++ b/Assets/VRM/UniHumanoid/Editor/BoneMappingEditor.cs @@ -409,9 +409,12 @@ animator.GetBoneTransform(x.Head), animator.GetBoneTransform(x.Tail))) { DrawBone((HumanBodyBones)i, bones[i]); } - foreach(var x in m_bones) + if (m_bones != null) { - x.Draw(); + foreach (var x in m_bones) + { + x.Draw(); + } } } } diff --git a/Assets/VRM/UniVRM/Editor/Format/VRMEditorExporter.cs b/Assets/VRM/UniVRM/Editor/Format/VRMEditorExporter.cs index 0cd072270..5386cc2f1 100644 --- a/Assets/VRM/UniVRM/Editor/Format/VRMEditorExporter.cs +++ b/Assets/VRM/UniVRM/Editor/Format/VRMEditorExporter.cs @@ -127,22 +127,25 @@ namespace VRM if (settings.PoseFreeze) { // BoneNormalizer.Execute は Copy を作って正規化する。UNDO無用 - target = BoneNormalizer.Execute(target, settings.ForceTPose, false); + target = BoneNormalizer.Execute(target, settings.ForceTPose, false); destroy.Add(target); } // 元のBlendShapeClipに変更を加えないように複製 var proxy = target.GetComponent(); - var copyBlendShapeAvatar = CopyBlendShapeAvatar(proxy.BlendShapeAvatar, settings.ReduceBlendshapeClip); - proxy.BlendShapeAvatar = copyBlendShapeAvatar; - - // BlendShape削減 - if (settings.ReduceBlendshape) + if (proxy != null) { - foreach (SkinnedMeshRenderer smr in target.GetComponentsInChildren()) + var copyBlendShapeAvatar = CopyBlendShapeAvatar(proxy.BlendShapeAvatar, settings.ReduceBlendshapeClip); + proxy.BlendShapeAvatar = copyBlendShapeAvatar; + + // BlendShape削減 + if (settings.ReduceBlendshape) { - // 未使用のBlendShapeを間引く - ReplaceMesh(target, smr, copyBlendShapeAvatar); + foreach (SkinnedMeshRenderer smr in target.GetComponentsInChildren()) + { + // 未使用のBlendShapeを間引く + ReplaceMesh(target, smr, copyBlendShapeAvatar); + } } }