diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index d45f03b1..be5a0b63 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 2e5625bb..9437b730 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index ab498515..45de696c 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/BodyB_Ysi.szs b/Switch_FileFormatsMain/BodyB_Ysi.szs new file mode 100644 index 00000000..c4a075fb Binary files /dev/null and b/Switch_FileFormatsMain/BodyB_Ysi.szs differ diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs index 697def03..31e82962 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs @@ -176,10 +176,13 @@ namespace Bfres.Structs uvMenu.DropDownItems.Add(new ToolStripMenuItem("Flip (Vertical)", null, FlipUvsVertical)); uvMenu.DropDownItems.Add(new ToolStripMenuItem("Flip (Horizontal)", null, FlipUvsHorizontal)); uvMenu.DropDownItems.Add(new ToolStripMenuItem("Copy Channel", null, CopyUVChannelAction)); + // uvMenu.DropDownItems.Add(new ToolStripMenuItem("Unwrap By Position", null, UVUnwrapPosition)); + ContextMenuStrip.Items.Add(uvMenu); ToolStripMenuItem normalsMenu = new ToolStripMenuItem("Normals"); normalsMenu.DropDownItems.Add(new ToolStripMenuItem("Smooth", null, SmoothNormals)); + normalsMenu.DropDownItems.Add(new ToolStripMenuItem("Invert", null, InvertNormals)); normalsMenu.DropDownItems.Add(new ToolStripMenuItem("Recalculate", null, RecalculateNormals)); ContextMenuStrip.Items.Add(normalsMenu); @@ -235,6 +238,16 @@ namespace Bfres.Structs { ((BFRES)Parent.Parent.Parent.Parent).LoadEditors(this); } + + private void UVUnwrapPosition(object sender, EventArgs args) + { + Cursor.Current = Cursors.WaitCursor; + UVUnwrapPosition(); + SaveVertexBuffer(GetResFileU() != null); + UpdateVertexData(); + Cursor.Current = Cursors.Default; + } + private void SmoothNormals(object sender, EventArgs args) { Cursor.Current = Cursors.WaitCursor; @@ -244,6 +257,15 @@ namespace Bfres.Structs Cursor.Current = Cursors.Default; } + private void InvertNormals(object sender, EventArgs args) + { + Cursor.Current = Cursors.WaitCursor; + InvertNormals(); + SaveVertexBuffer(GetResFileU() != null); + UpdateVertexData(); + Cursor.Current = Cursors.Default; + } + private void GenerateBoundingBoxes(object sender, EventArgs args) { Cursor.Current = Cursors.WaitCursor; diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index d3bd5166..3ffd8f9b 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache index d3f693f3..e4bcbb85 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache differ diff --git a/Switch_Toolbox_Library/Forms/Dialogs/STErrorDialog.Designer.cs b/Switch_Toolbox_Library/Forms/Dialogs/STErrorDialog.Designer.cs index 1f74fe43..a258cc64 100644 --- a/Switch_Toolbox_Library/Forms/Dialogs/STErrorDialog.Designer.cs +++ b/Switch_Toolbox_Library/Forms/Dialogs/STErrorDialog.Designer.cs @@ -81,10 +81,10 @@ // this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblMessage.Location = new System.Drawing.Point(52, 12); + this.lblMessage.Location = new System.Drawing.Point(52, 9); this.lblMessage.MaximumSize = new System.Drawing.Size(310, 0); this.lblMessage.Name = "lblMessage"; - this.lblMessage.Size = new System.Drawing.Size(288, 37); + this.lblMessage.Size = new System.Drawing.Size(288, 40); this.lblMessage.TabIndex = 5; this.lblMessage.Text = "label1"; // diff --git a/Switch_Toolbox_Library/Generics/GenericObject.cs b/Switch_Toolbox_Library/Generics/GenericObject.cs index 90243ced..caeaafbc 100644 --- a/Switch_Toolbox_Library/Generics/GenericObject.cs +++ b/Switch_Toolbox_Library/Generics/GenericObject.cs @@ -373,6 +373,21 @@ namespace Switch_Toolbox.Library } } + public void InvertNormals() + { + foreach (Vertex v in vertices) + { + v.nrm = new Vector3(-1 * v.nrm.X, -1 * v.nrm.Y, -1 * v.nrm.Z); + } + } + + public void UVUnwrapPosition() + { + foreach (Vertex v in vertices) + { + } + } + public void CalculateNormals() { if (vertices.Count < 3)