1
0
mirror of synced 2024-11-28 09:20:57 +01:00

Fix materials not mapping to objects

This commit is contained in:
KillzXGaming 2019-03-26 18:01:57 -04:00
parent 110d589086
commit b4c297f572
8 changed files with 5 additions and 1 deletions

Binary file not shown.

View File

@ -867,12 +867,14 @@ namespace Bfres.Structs
shape.vertexAttributes = settings.CreateNewAttributes();
shape.BoneIndex = obj.BoneIndex;
STConsole.WriteLine(Text + " " + obj.MaterialIndex);
if (UseMats)
shape.MaterialIndex = obj.MaterialIndex + MatStartIndex;
else
shape.MaterialIndex = 0;
if (materials.Count >= shape.MaterialIndex)
if (shape.MaterialIndex >= materials.Count)
shape.MaterialIndex = 0;
shape.Text = obj.ObjectName;

View File

@ -204,6 +204,8 @@ namespace Switch_Toolbox.Library
matTex.wrapModeS = SetWrapMode(tex.WrapModeU);
matTex.wrapModeT = SetWrapMode(tex.WrapModeV);
STConsole.WriteLine($"Getting assimp texture slot {matTex.Name} Type {matTex.Type}");
return matTex;
}
private int SetWrapMode(TextureWrapMode wrap)