DA4E : Fix a bug with material mapping on export
This commit is contained in:
parent
06abad5d4a
commit
9c9c9126a5
@ -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 New Issue
Block a user