mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
DA4E : Fix a bug with material mapping on export
This commit is contained in:
parent
06abad5d4a
commit
9c9c9126a5
3 changed files with 5 additions and 2 deletions
|
@ -354,6 +354,8 @@ namespace FirstPlugin
|
|||
var textures = new List<STGenericTexture>();
|
||||
foreach (var mesh in Renderer.Meshes)
|
||||
materials.Add(mesh.GetMaterial());
|
||||
foreach (var mesh in Renderer.Meshes)
|
||||
mesh.MaterialIndex = materials.IndexOf(mesh.GetMaterial());
|
||||
foreach (var tex in Renderer.TextureList)
|
||||
textures.Add(tex);
|
||||
|
||||
|
|
|
@ -270,6 +270,7 @@ namespace Toolbox.Library
|
|||
if (mesh.MaterialIndex != -1 && Materials.Count > mesh.MaterialIndex)
|
||||
{
|
||||
writer.CurrentMaterial = Materials[mesh.MaterialIndex].Text;
|
||||
Console.WriteLine($"MaterialIndex {mesh.MaterialIndex } {Materials[mesh.MaterialIndex].Text}");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ namespace Toolbox.Library
|
|||
|
||||
public class STGenericPolygonGroup
|
||||
{
|
||||
public virtual STGenericMaterial Material { get; set; }
|
||||
public virtual STGenericMaterial Material { get; set; } = null;
|
||||
|
||||
public int Offset { get; set; }
|
||||
public int MaterialIndex { get; set; }
|
||||
public int MaterialIndex { get; set; } = -1;
|
||||
public int Index { get; set; }
|
||||
|
||||
public List<int> faces = new List<int>();
|
||||
|
|
Loading…
Reference in a new issue