Load all containers to uv editor if drawables is set to preview al

This commit is contained in:
KillzXGaming 2019-08-12 19:37:57 -04:00
parent 9e61c677ed
commit 89ce65908c

View file

@ -92,12 +92,16 @@ namespace Toolbox.Library
}
}
public DrawableContainer GetActiveContainer()
public List<DrawableContainer> GetActiveContainers()
{
if (drawContainersCB.SelectedIndex - 1 < 0)
if (drawContainersCB.SelectedIndex < 0)
return null;
return DrawableContainers[drawContainersCB.SelectedIndex - 1];
if (drawContainersCB.SelectedIndex == 0 || DisplayAll)
return DrawableContainers;
return new List<DrawableContainer>()
{ DrawableContainers[drawContainersCB.SelectedIndex - 1], };
}
//Reloads drawable containers with the active container selected
@ -590,10 +594,12 @@ namespace Toolbox.Library
if (!Runtime.UseOpenGL)
return;
var container = GetActiveContainer();
if (container == null) return;
var containers = GetActiveContainers();
if (containers.Count == 0) return;
List<STGenericObject> meshes = new List<STGenericObject>();
foreach (var container in containers)
{
for (int i = 0; i < container.Drawables.Count; i++)
{
if (container.Drawables[i] is IMeshContainer && container.Drawables[i].Visible)
@ -602,8 +608,7 @@ namespace Toolbox.Library
meshes.Add(((IMeshContainer)container.Drawables[i]).Meshes[m]);
}
}
Console.WriteLine($"MeshCount " + meshes.Count);
}
if (meshes.Count > 0)
{