mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 22:09:53 -05:00
Merge pull request #378 from neon-izm/feature/export_check_dupicate_bone_names
Check bone names duplicate when export vrm file.
This commit is contained in:
commit
5bfc57564e
|
|
@ -60,7 +60,12 @@ namespace VRM
|
|||
{
|
||||
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 @@ namespace VRM
|
|||
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
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user