シーン構成によっては、稀にエラーになるっぽい? #1592

例えば、エクスポート対象ヒエラルキーの外部の GameObject が rootBone セットされている
This commit is contained in:
ousttrue
2022-04-12 17:07:21 +09:00
parent 5d524b0cf9
commit 00cad8b5b0

View File

@@ -424,7 +424,10 @@ namespace UniGLTF.MeshUtility
dstRenderer.sharedMaterials = srcRenderer.sharedMaterials;
if (srcRenderer.rootBone != null)
{
dstRenderer.rootBone = boneMap[srcRenderer.rootBone];
if (boneMap.TryGetValue(srcRenderer.rootBone, out Transform found))
{
dstRenderer.rootBone = found;
}
}
dstRenderer.bones = dstBones;
dstRenderer.sharedMesh = mesh;