1
0
mirror of synced 2024-11-28 01:10:51 +01:00

Fix sarc's with folders saving wrong

This commit is contained in:
KillzXGaming 2019-03-24 16:44:12 -04:00
parent 5e4313c54f
commit c75c171792
12 changed files with 27 additions and 5 deletions

Binary file not shown.

View File

@ -14,8 +14,8 @@ namespace FirstPlugin
public class SARC : TreeNodeFile, IFileFormat
{
public bool CanSave { get; set; }
public string[] Description { get; set; } = new string[] { "SARC", "SARC", "SARC", "SARC", "SARC" };
public string[] Extension { get; set; } = new string[] { "*.pack", "*.sarc", "*.bgenv", "*.sblarc", "*.sbactorpack" };
public string[] Description { get; set; } = new string[] { "SARC", "SARC", "SARC", "SARC", "SARC", "SARC" };
public string[] Extension { get; set; } = new string[] { "*.pack", "*.sarc", "*.bgenv", "*.sblarc", "*.sbactorpack", ".arc" };
public string FileName { get; set; }
public string FilePath { get; set; }
public IFileInfo IFileInfo { get; set; }
@ -195,11 +195,15 @@ namespace FirstPlugin
{
string dir = Path.GetDirectoryName(sarc.FullName);
Console.WriteLine("CurrentFullName " + sarc.FullName);
if (dir == string.Empty)
sarc.FullName = sarc.Text;
else
sarc.FullName = Path.Combine(dir, sarc.Text);
sarc.FullName = sarc.FullName.Replace(@"\", "/");
sarcData.Files.Add(sarc.FullName, sarc.Data);
}
public static void ReplaceNode(TreeNode node, TreeNode replaceNode, TreeNode NewNode)

View File

@ -909,6 +909,14 @@ namespace Bfres.Structs
else
return Vector3.TransformNormal(position, trans);
}
public static Vector3 transform(Vector3 input, Matrix4 matrix)
{
Vector3 output = new Vector3();
output.X = input.X * matrix.M11 + input.Y * matrix.M21 + input.Z * matrix.M31 + matrix.M41;
output.Y = input.X * matrix.M12 + input.Y * matrix.M22 + input.Z * matrix.M32 + matrix.M42;
output.Z = input.X * matrix.M13 + input.Y * matrix.M23 + input.Z * matrix.M33 + matrix.M43;
return output;
}
public void SaveVertexBuffer()
{
if (IsWiiU)

View File

@ -186,7 +186,6 @@ namespace FirstPlugin
else
GL.Color4(Color.OrangeRed);
foreach (FSHP.BoundingBox box in m.boundingBoxes)
{
RenderTools.DrawRectangularPrism(box.Center, box.Extend.X, box.Extend.Y, box.Extend.Z, true);
@ -602,7 +601,13 @@ namespace FirstPlugin
if (m.Checked && mdl.Skeleton.bones[m.BoneIndex].Visible)
{
if ((m.IsSelected))
shader.SetVector3("materialSelectColor", new Vector3(0));
if (m.GetMaterial().IsSelected)
{
shader.SetVector3("materialSelectColor", ColorUtility.ToVector3(Color.FromArgb(0,163,204)));
DrawModelSelection(m, shader);
}
else if ((m.IsSelected))
{
DrawModelSelection(m, shader);
}
@ -813,7 +818,6 @@ namespace FirstPlugin
shader.SetVector3("albedo_tex_color", new Vector3(1, 1, 1));
shader.SetVector3("emission_color", new Vector3(1, 1, 1));
shader.SetVector3("specular_color", new Vector3(1, 1, 1));
shader.SetFloat("fuv1_mtx", 0);

View File

@ -129,6 +129,8 @@ namespace Switch_Toolbox.Library.Forms
return true;
if (obj is STBone)
return true;
if (obj is STGenericMaterial)
return true;
return false;
}

View File

@ -52,6 +52,8 @@ uniform vec4 pickingColor;
uniform int isTransparent;
uniform vec3 materialSelectColor;
// Shader Params
uniform float normal_map_weight;
uniform float ao_density;
@ -260,6 +262,8 @@ void main()
fragColor *= min(vec4(albedo_tex_color, 1), vec4(1));
fragColor.rgb += materialSelectColor * 0.5f;
// Toggles rendering of individual color channels for all render modes.
fragColor.rgb *= vec3(renderR, renderG, renderB);
if (renderR == 1 && renderG == 0 && renderB == 0)