diff --git a/Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs b/Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs index 61bccd9aad..cf3ec51c0d 100644 --- a/Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs +++ b/Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs @@ -60,7 +60,12 @@ public IEnumerable CanExport() { yield return "Animator.avatar is not humanoid. Please change model's AnimationType to humanoid. "; } - + + if (DuplicateBoneNameExists()) + { + yield return "Find duplicate Bone names. Please check model's bone names. "; + } + if (string.IsNullOrEmpty(Title)) { yield return "Require Title. "; @@ -402,6 +407,18 @@ void Export(string path, List destroy) AssetDatabase.ImportAsset(path.ToUnityRelativePath()); } } + + //ここで重複ボーン名のチェックをする + bool DuplicateBoneNameExists() + { + var bones = Source.transform.Traverse().ToArray(); + var duplicates = bones + .GroupBy(p => p.name) + .Where(g => g.Count() > 1) + .Select(g => g.Key); + + return (duplicates.Any()); + } #endif } } \ No newline at end of file