1
0
mirror of synced 2025-01-19 01:14:08 +01:00

A few fixes to archives

This commit is contained in:
KillzXGaming 2019-06-08 20:19:55 -04:00
parent 28cc63a95c
commit f6fdae96f6
10 changed files with 51 additions and 37 deletions

Binary file not shown.

View File

@ -191,46 +191,46 @@ namespace Switch_Toolbox.Library
{
string line = dae.ReadLine();
/* if (line == " <library_visual_scenes>")
{
AddControllerLibrary(outScene, test);
test.WriteLine(line);
test.Flush();
}*/
if (line.Contains("<node"))
if (line == " <library_visual_scenes>")
{
AddControllerLibrary(outScene, test);
test.WriteLine(line);
test.Flush();
/* string[] testLn = line.Split('\"');
string name = testLn[3];
string jointLine = line.Replace(">", $" sid=\"{ name }\" type=\"JOINT\">");
test.WriteLine(jointLine);
test.Flush();*/
}
/* else if (line.Contains("</visual_scene>"))
else if (line.Contains("<node"))
{
// test.WriteLine(line);
// test.Flush();
string[] testLn = line.Split('\"');
string name = testLn[3];
string jointLine = line.Replace(">", $" sid=\"{ name }\" type=\"JOINT\">");
test.WriteLine(jointLine);
test.Flush();
}
else if (line.Contains("</visual_scene>"))
{
foreach (Mesh mesh in outScene.Meshes)
{
foreach (Mesh mesh in outScene.Meshes)
{
test.WriteLine($" <node id=\"{ mesh.Name }\" name=\"{ mesh.Name }\" type=\"NODE\">");
test.WriteLine($" <node id=\"{ mesh.Name }\" name=\"{ mesh.Name }\" type=\"NODE\">");
test.WriteLine($" <instance_controller url=\"#{ mesh.Name }-skin\">");
test.WriteLine(" <skeleton>#skeleton_root</skeleton>");
test.WriteLine(" <bind_material>");
test.WriteLine(" <technique_common>");
test.WriteLine($" <instance_material symbol=\"theresonlyone\" target=\"#m{ mesh.MaterialIndex }mat\" />");
test.WriteLine(" </technique_common>");
test.WriteLine(" </bind_material>");
test.WriteLine(" </instance_controller>");
test.WriteLine($" <instance_controller url=\"#{ mesh.Name }-skin\">");
test.WriteLine(" <skeleton>#skeleton_root</skeleton>");
test.WriteLine(" <bind_material>");
test.WriteLine(" <technique_common>");
test.WriteLine($" <instance_material symbol=\"theresonlyone\" target=\"#m{ mesh.MaterialIndex }mat\" />");
test.WriteLine(" </technique_common>");
test.WriteLine(" </bind_material>");
test.WriteLine(" </instance_controller>");
test.WriteLine(" </node>");
test.Flush();
}
test.WriteLine(line);
test.WriteLine(" </node>");
test.Flush();
}*/
}
test.WriteLine(line);
test.Flush();
}
else if (line.Contains("<geometry"))
{
string RealMeshName = Model.Nodes[0].Nodes[geomIndex].Text;

View File

@ -127,6 +127,8 @@ namespace Switch_Toolbox.Library.Forms
if (treeViewCustom1.Nodes[0] is IFileFormat)
return (IFileFormat)treeViewCustom1.Nodes[0];
if (treeViewCustom1.Nodes[0] is ArchiveBase)
return (IFileFormat)((ArchiveBase)treeViewCustom1.Nodes[0]).ArchiveFile;
return null;
}

View File

@ -523,6 +523,9 @@ namespace Switch_Toolbox.Library
int index = node.Nodes.IndexOf(replaceNode);
node.Nodes.RemoveAt(index);
node.Nodes.Insert(index, NewNode);
NewNode.ImageKey = replaceNode.ImageKey;
NewNode.SelectedImageKey = replaceNode.SelectedImageKey;
}
private void RenameAction(object sender, EventArgs args)

View File

@ -48,10 +48,10 @@ namespace Switch_Toolbox.Library.Rendering
GL.Enable(EnableCap.DepthTest);
GL.DepthFunc(DepthFunction.Lequal);
GL.Enable(EnableCap.LineSmooth);
// GL.Enable(EnableCap.LineSmooth);
GL.Enable(EnableCap.StencilTest);
GL.StencilOp(StencilOp.Keep, StencilOp.Keep, StencilOp.Replace);
// GL.Enable(EnableCap.StencilTest);
// GL.StencilOp(StencilOp.Keep, StencilOp.Keep, StencilOp.Replace);
control.CurrentShader = defaultShaderProgram;
@ -71,6 +71,7 @@ namespace Switch_Toolbox.Library.Rendering
if (RenderTools.diffusePbr != null)
{
GL.ActiveTexture(TextureUnit.Texture0);
RenderTools.diffusePbr.Bind();
}
}

View File

@ -400,9 +400,17 @@ namespace Toolbox
{
foreach (var node in editor.GetNodes())
{
if (node is IFileFormat)
IFileFormat format = null;
if (node is ArchiveBase)
{
format = (IFileFormat)((ArchiveBase)node).ArchiveFile;
}
else if (node is IFileFormat)
{
format = ((IFileFormat)node);
}
if (format != null)
{
var format = ((IFileFormat)node);
if (!format.CanSave)
return;