1
0
mirror of synced 2025-01-19 09:17:30 +01:00

Prevent texture dupes in gfbmdl

This commit is contained in:
KillzXGaming 2019-11-26 20:12:03 -05:00
parent eb8f70f752
commit a8ad624e53

View File

@ -113,11 +113,14 @@ namespace FirstPlugin
}
}
List<string> loadedTextures = new List<string>();
for (int i = 0; i < Model.Textures.Count; i++)
{
foreach (var bntx in PluginRuntime.bntxContainers)
{
if (bntx.Textures.ContainsKey(Model.Textures[i]))
if (bntx.Textures.ContainsKey(Model.Textures[i]) &&
!loadedTextures.Contains(Model.Textures[i]))
{
TreeNode tex = new TreeNode(Model.Textures[i]);
tex.ImageKey = "texture";
@ -125,10 +128,13 @@ namespace FirstPlugin
tex.Tag = bntx.Textures[Model.Textures[i]];
Textures.Nodes.Add(tex);
loadedTextures.Add(Model.Textures[i]);
}
}
}
loadedTextures.Clear();
Nodes.Add(MaterialFolderWrapper);
Nodes.Add(VisualGroupWrapper);
if (Textures.Nodes.Count > 0)