Some texture map fixes for g1m dae exporting

This commit is contained in:
KillzXGaming 2020-02-08 10:45:33 -05:00
parent 4a1c51737d
commit 99306683d0
4 changed files with 12 additions and 3 deletions

View file

@ -94,7 +94,7 @@ namespace FirstPlugin
for (int t = 0; t < Chunks[i].Textures.Count; t++)
{
var texWrapper = new TextureWrapper();
texWrapper.Text = $"Texture {t}";
texWrapper.Text = $"Texture_{t}";
texWrapper.ImageKey = "texture";
texWrapper.SelectedImageKey = texWrapper.ImageKey;

View file

@ -99,8 +99,16 @@ namespace HyruleWarriors.G1M
{
get {
List<STGenericMaterial> materials = new List<STGenericMaterial>();
foreach (var mat in Model.Materials)
foreach (var mat in Model.Materials) {
materials.Add(mat);
foreach (G1MTextureMap texMap in mat.TextureMaps)
{
var texList = TextureList;
if (texList.Count > texMap.TextureIndex) {
texMap.Name = texList[texMap.TextureIndex].Text;
}
}
}
return materials;
}
}

View file

@ -95,6 +95,7 @@ namespace HyruleWarriors.G1M
genericMesh.PolygonGroups.Add(polyGroup);
var mat = Materials[(int)meshInfo.TextureID];
mat.Text = $"Material_{meshInfo.TextureID}";
mat.Diffuse.TextureIndex = mat.TextureIndices[0][0];
polyGroup.Material = mat;

View file

@ -98,7 +98,7 @@ namespace FirstPlugin
GITextureWrapper tex = new GITextureWrapper(this);
tex.ImageKey = "texture";
tex.SelectedImageKey = tex.ImageKey;
tex.Text = $"Texture {i} {format.ToString("x")}";
tex.Text = $"Texture_{i}";
tex.Width = Width;
tex.Height = Height;
tex.MipCount = (uint)mipSys >> 4;