diff --git a/.gitignore b/.gitignore index 93ae6be5..cab2c172 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .vs/Switch_Toolbox/v15/Server/sqlite3/db.lock *NodeEditorWinforms-master *GL_EditorFramework-master +*Assimp *.resources Debug/ Release/ \ No newline at end of file diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 3c80f9bc..02f7976f 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 03a43615..a5c68c05 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 b2c55766..9b97a91b 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/FileFormats/BFRES/BFRES.cs b/Switch_FileFormatsMain/FileFormats/BFRES/BFRES.cs index a0c7b3c7..4df55df6 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/BFRES.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/BFRES.cs @@ -1281,10 +1281,9 @@ namespace FirstPlugin case BRESGroupType.SkeletalAnim: foreach (FSKA ska in group.Nodes) { - // ska.SkeletalAnim.BoneAnims.Clear(); - - // foreach (FSKA.BoneAnimNode bone in ska.Bones) - // ska.SkeletalAnim.BoneAnims.Add(bone.SaveData()); + ska.SkeletalAnim.BoneAnims.Clear(); + foreach (FSKA.BoneAnimNode bone in ska.Bones) + ska.SkeletalAnim.BoneAnims.Add(bone.SaveData(ska.IsEdited)); ska.SkeletalAnim.Name = ska.Text; resFile.SkeletalAnims.Add(ska.SkeletalAnim); @@ -1299,7 +1298,7 @@ namespace FirstPlugin { fmaa.MaterialAnim.MaterialAnimDataList.Clear(); foreach (FMAA.MaterialAnimEntry mat in fmaa.Materials) - fmaa.MaterialAnim.MaterialAnimDataList.Add(mat.SaveData()); + fmaa.MaterialAnim.MaterialAnimDataList.Add(mat.SaveData(fmaa.IsEdited)); fmaa.SetName(); fmaa.SaveAnimData(); @@ -1415,7 +1414,7 @@ namespace FirstPlugin { ska.SkeletalAnimU.BoneAnims.Clear(); foreach (FSKA.BoneAnimNode bone in ska.Bones) - ska.SkeletalAnimU.BoneAnims.Add(bone.SaveDataU()); + ska.SkeletalAnimU.BoneAnims.Add(bone.SaveDataU(ska.IsEdited)); ska.SkeletalAnimU.Name = ska.Text; resFileU.SkeletalAnims.Add(ska.Text, ska.SkeletalAnimU); @@ -1426,7 +1425,7 @@ namespace FirstPlugin { anim.ShaderParamAnim.ShaderParamMatAnims.Clear(); foreach (FSHU.MaterialAnimEntry bone in anim.Materials) - anim.ShaderParamAnim.ShaderParamMatAnims.Add(bone.SaveData()); + anim.ShaderParamAnim.ShaderParamMatAnims.Add(bone.SaveData(anim.IsEdited)); anim.ShaderParamAnim.Name = anim.Text; @@ -1437,8 +1436,8 @@ namespace FirstPlugin foreach (FSHU anim in group.Nodes) { anim.ShaderParamAnim.ShaderParamMatAnims.Clear(); - foreach (FSHU.MaterialAnimEntry bone in anim.Materials) - anim.ShaderParamAnim.ShaderParamMatAnims.Add(bone.SaveData()); + foreach (FSHU.MaterialAnimEntry mat in anim.Materials) + anim.ShaderParamAnim.ShaderParamMatAnims.Add(mat.SaveData(anim.IsEdited)); anim.ShaderParamAnim.Name = anim.Text; resFileU.ColorAnims.Add(anim.Text, anim.ShaderParamAnim); @@ -1448,8 +1447,8 @@ namespace FirstPlugin foreach (FSHU anim in group.Nodes) { anim.ShaderParamAnim.ShaderParamMatAnims.Clear(); - foreach (FSHU.MaterialAnimEntry bone in anim.Materials) - anim.ShaderParamAnim.ShaderParamMatAnims.Add(bone.SaveData()); + foreach (FSHU.MaterialAnimEntry mat in anim.Materials) + anim.ShaderParamAnim.ShaderParamMatAnims.Add(mat.SaveData(anim.IsEdited)); anim.ShaderParamAnim.Name = anim.Text; resFileU.TexSrtAnims.Add(anim.Text, anim.ShaderParamAnim); @@ -1458,6 +1457,10 @@ namespace FirstPlugin case BRESGroupType.TexPatAnim: foreach (FTXP anim in group.Nodes) { + anim.TexPatternAnim.TexPatternMatAnims.Clear(); + foreach (FTXP.MaterialAnimEntry mat in anim.Materials) + anim.TexPatternAnim.TexPatternMatAnims.Add(mat.SaveData(anim.IsEdited)); + anim.TexPatternAnim.Name = anim.Text; resFileU.TexPatternAnims.Add(anim.Text, anim.TexPatternAnim); } diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMAA.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMAA.cs index f6cf8ea6..261b4ba3 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMAA.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMAA.cs @@ -83,9 +83,13 @@ namespace Bfres.Structs } - public MaterialAnimData SaveData() + public MaterialAnimData SaveData(bool IsEdited) { MaterialAnimData.Name = Text; + if (IsEdited) + { + + } return MaterialAnimData; } } @@ -476,7 +480,7 @@ namespace Bfres.Structs return MatAnimWrapper.Textures[(int)val]; } - public void AddKeyFrame(string TextureName, int Frame, bool IsConstant = false) + public void AddKeyFrame(string TextureName, float Frame = -1, bool IsConstant = false) { group.Constant = IsConstant; @@ -491,6 +495,11 @@ namespace Bfres.Structs //Set our index int index = MatAnimWrapper.Textures.IndexOf(TextureName); + if (Frame == -1) + { + Frame = group.EndFrame + 1; //Add to the end of the list by default + } + //For non constants we load a curve if (!group.Constant) { diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FSHU.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FSHU.cs index b0976b5f..d452e852 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FSHU.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FSHU.cs @@ -148,9 +148,13 @@ namespace Bfres.Structs materialAnimData = data; } - public ShaderParamMatAnim SaveData() + public ShaderParamMatAnim SaveData(bool IsEdited) { materialAnimData.Name = Text; + if (IsEdited) + { + + } return materialAnimData; } } diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FSKA.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FSKA.cs index 2552e77b..4c8f265e 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FSKA.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FSKA.cs @@ -533,17 +533,23 @@ namespace Bfres.Structs public BoneAnim BoneAnim; public ResU.BoneAnim BoneAnimU; - public ResU.BoneAnim SaveDataU() + public ResU.BoneAnim SaveDataU(bool IsEdited) { BoneAnimU.Name = Text; + if (IsEdited) + { + } return BoneAnimU; } - public BoneAnim SaveData() + public BoneAnim SaveData(bool IsEdited) { BoneAnim.Name = Text; + if (IsEdited) + { + } return BoneAnim; } diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FTXP.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FTXP.cs index 956a9f20..5bb3bcd3 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FTXP.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FTXP.cs @@ -116,9 +116,13 @@ namespace Bfres.Structs TexPatternMatAnim = data; } - public TexPatternMatAnim SaveData() + public TexPatternMatAnim SaveData(bool IsEdited) { TexPatternMatAnim.Name = Text; + if (IsEdited) + { + + } return TexPatternMatAnim; } } diff --git a/Switch_FileFormatsMain/GUI/BFRES/TexturePattern/BfresTexturePatternEditor.cs b/Switch_FileFormatsMain/GUI/BFRES/TexturePattern/BfresTexturePatternEditor.cs index 626c44ac..6fe4c5de 100644 --- a/Switch_FileFormatsMain/GUI/BFRES/TexturePattern/BfresTexturePatternEditor.cs +++ b/Switch_FileFormatsMain/GUI/BFRES/TexturePattern/BfresTexturePatternEditor.cs @@ -464,8 +464,19 @@ namespace FirstPlugin.Forms { string NewTex = editor.GetSelectedTexture(); + if (ActiveMaterialAnim.Textures == null) + ActiveMaterialAnim.Textures = new List(); + if (!ActiveMaterialAnim.Textures.Contains(NewTex)) ActiveMaterialAnim.Textures.Add(NewTex); + + if (activeSampler != null) + { + activeSampler.AddKeyFrame(NewTex); + } + else + { + } } } diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 2803c5a1..2a667577 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 5f8faeba..8caf3e0f 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/FileFormats/Assimp/Assimp.cs b/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs index 7fb4ca94..db0f8ac2 100644 --- a/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs +++ b/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs @@ -488,7 +488,10 @@ namespace Switch_Toolbox.Library if (msh.HasTangentBasis) vert.tan = new Vector4(msh.Tangents[v].X, msh.Tangents[v].Y, msh.Tangents[v].Z, 1); if (msh.HasVertexColors(0)) + { vert.col = new Vector4(msh.VertexColorChannels[0][v].R, msh.VertexColorChannels[0][v].G, msh.VertexColorChannels[0][v].B, msh.VertexColorChannels[0][v].A); + Console.WriteLine("VTX Col " + vert.col); + } if (msh.HasTangentBasis) vert.bitan = new Vector4(msh.BiTangents[v].X, msh.BiTangents[v].Y, msh.BiTangents[v].Z, 1); vertices.Add(vert); diff --git a/Toolbox/Assimp32.zip b/Toolbox/Assimp32.zip new file mode 100644 index 00000000..4c8ad0ef Binary files /dev/null and b/Toolbox/Assimp32.zip differ diff --git a/Toolbox/Lib/AssimpNet.pdb b/Toolbox/Lib/AssimpNet.pdb new file mode 100644 index 00000000..d142b1b5 Binary files /dev/null and b/Toolbox/Lib/AssimpNet.pdb differ diff --git a/Toolbox/Lib/AssimpNet.zip b/Toolbox/Lib/AssimpNet.zip new file mode 100644 index 00000000..0b2897c4 Binary files /dev/null and b/Toolbox/Lib/AssimpNet.zip differ