mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Load all containers to uv editor if drawables is set to preview al
This commit is contained in:
parent
9e61c677ed
commit
89ce65908c
1 changed files with 16 additions and 11 deletions
|
@ -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,21 +594,22 @@ 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>();
|
||||
for (int i = 0; i < container.Drawables.Count; i++)
|
||||
foreach (var container in containers)
|
||||
{
|
||||
if (container.Drawables[i] is IMeshContainer && container.Drawables[i].Visible)
|
||||
for (int i = 0; i < container.Drawables.Count; i++)
|
||||
{
|
||||
for (int m = 0; m < ((IMeshContainer)container.Drawables[i]).Meshes.Count; m++)
|
||||
meshes.Add(((IMeshContainer)container.Drawables[i]).Meshes[m]);
|
||||
if (container.Drawables[i] is IMeshContainer && container.Drawables[i].Visible)
|
||||
{
|
||||
for (int m = 0; m < ((IMeshContainer)container.Drawables[i]).Meshes.Count; m++)
|
||||
meshes.Add(((IMeshContainer)container.Drawables[i]).Meshes[m]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine($"MeshCount " + meshes.Count);
|
||||
|
||||
if (meshes.Count > 0)
|
||||
{
|
||||
UVEditorForm uvEditor1 = new UVEditorForm();
|
||||
|
|
Loading…
Reference in a new issue