1
0
mirror of synced 2024-11-12 10:10:50 +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.vertexAttributes = settings.CreateNewAttributes();
shape.BoneIndex = obj.BoneIndex; shape.BoneIndex = obj.BoneIndex;
STConsole.WriteLine(Text + " " + obj.MaterialIndex);
if (UseMats) if (UseMats)
shape.MaterialIndex = obj.MaterialIndex + MatStartIndex; shape.MaterialIndex = obj.MaterialIndex + MatStartIndex;
else else
shape.MaterialIndex = 0; shape.MaterialIndex = 0;
if (materials.Count >= shape.MaterialIndex) if (shape.MaterialIndex >= materials.Count)
shape.MaterialIndex = 0; shape.MaterialIndex = 0;
shape.Text = obj.ObjectName; shape.Text = obj.ObjectName;

View File

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