mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-26 06:20:24 +00:00
DAE : Add better check for valid material index
This commit is contained in:
parent
7ebcb88342
commit
2030582de2
1 changed files with 2 additions and 2 deletions
|
@ -217,7 +217,7 @@ namespace Toolbox.Library
|
|||
|
||||
writer.StartGeometry(mesh.Text);
|
||||
|
||||
if (mesh.MaterialIndex != -1)
|
||||
if (mesh.MaterialIndex != -1 && Materials.Count > mesh.MaterialIndex)
|
||||
{
|
||||
writer.CurrentMaterial = Materials[mesh.MaterialIndex].Text;
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ namespace Toolbox.Library
|
|||
|
||||
triangleLists.Add(triangleList);
|
||||
|
||||
if (group.MaterialIndex != -1)
|
||||
if (group.MaterialIndex != -1 && Materials.Count > group.MaterialIndex)
|
||||
triangleList.Material = Materials[group.MaterialIndex].Text;
|
||||
|
||||
List<int> faces = new List<int>();
|
||||
|
|
Loading…
Reference in a new issue