mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-14 14:29:52 -05:00
Fix MeshIntegratorWizard cannot run with insufficient materials for submeshes
This commit is contained in:
parent
356349f2a5
commit
cb0bf9ce24
|
|
@ -135,7 +135,7 @@ namespace UniGLTF.MeshUtility
|
|||
BindPoses.Add(bindpose);
|
||||
Bones.Add(bone);
|
||||
|
||||
for (int i = 0; i < mesh.subMeshCount; ++i)
|
||||
for (int i = 0; i < mesh.subMeshCount && i < renderer.sharedMaterials.Length; ++i)
|
||||
{
|
||||
var indices = mesh.GetIndices(i).Select(x => x + indexOffset);
|
||||
var mat = renderer.sharedMaterials[i];
|
||||
|
|
@ -193,7 +193,7 @@ namespace UniGLTF.MeshUtility
|
|||
Bones.Add(renderer.transform);
|
||||
}
|
||||
|
||||
for (int i = 0; i < mesh.subMeshCount; ++i)
|
||||
for (int i = 0; i < mesh.subMeshCount && i < renderer.sharedMaterials.Length; ++i)
|
||||
{
|
||||
var indices = mesh.GetIndices(i).Select(x => x + indexOffset);
|
||||
var mat = renderer.sharedMaterials[i];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user