mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 22:09:53 -05:00
bake 時に SkinnedMeshRenderer.bones に null が含まれていても通す
This commit is contained in:
parent
ae8541e3d6
commit
f1fb4cc7ea
|
|
@ -20,7 +20,19 @@ namespace UniGLTF.MeshUtility
|
|||
if (Bones != null)
|
||||
{
|
||||
// recalc bindposes
|
||||
Mesh.bindposes = Bones.Select(x => x.worldToLocalMatrix * dst.transform.localToWorldMatrix).ToArray();
|
||||
Mesh.bindposes = Bones.Select(x =>
|
||||
{
|
||||
if (x != null)
|
||||
{
|
||||
return x.worldToLocalMatrix * dst.transform.localToWorldMatrix;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ボーンが削除された
|
||||
return dst.transform.localToWorldMatrix;
|
||||
}
|
||||
}
|
||||
).ToArray();
|
||||
|
||||
if (dst.GetComponent<SkinnedMeshRenderer>() is SkinnedMeshRenderer dstRenderer)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user