diff --git a/AssetStudio/AssetStudioForm.cs b/AssetStudio/AssetStudioForm.cs index f246ef7..b3f99d3 100644 --- a/AssetStudio/AssetStudioForm.cs +++ b/AssetStudio/AssetStudioForm.cs @@ -1867,7 +1867,7 @@ namespace AssetStudio private void showOriginalFileToolStripMenuItem_Click(object sender, EventArgs e) { var selectasset = (AssetPreloadData)assetListView.Items[assetListView.SelectedIndices[0]]; - var args = $"/select, {selectasset.sourceFile.parentPath ?? selectasset.sourceFile.filePath}"; + var args = $"/select, \"{selectasset.sourceFile.parentPath ?? selectasset.sourceFile.filePath}\""; var pfi = new ProcessStartInfo("explorer.exe", args); Process.Start(pfi); } diff --git a/AssetStudio/ExportOptions.Designer.cs b/AssetStudio/ExportOptions.Designer.cs index 11db694..ec76ef8 100644 --- a/AssetStudio/ExportOptions.Designer.cs +++ b/AssetStudio/ExportOptions.Designer.cs @@ -50,7 +50,6 @@ this.groupBox2 = new System.Windows.Forms.GroupBox(); this.fbxVersion = new System.Windows.Forms.ComboBox(); this.label3 = new System.Windows.Forms.Label(); - this.FixRotation = new System.Windows.Forms.CheckBox(); this.flatInbetween = new System.Windows.Forms.CheckBox(); this.boneSize = new System.Windows.Forms.NumericUpDown(); this.label2 = new System.Windows.Forms.Label(); @@ -303,7 +302,6 @@ this.groupBox2.AutoSize = true; this.groupBox2.Controls.Add(this.fbxVersion); this.groupBox2.Controls.Add(this.label3); - this.groupBox2.Controls.Add(this.FixRotation); this.groupBox2.Controls.Add(this.flatInbetween); this.groupBox2.Controls.Add(this.boneSize); this.groupBox2.Controls.Add(this.label2); @@ -315,7 +313,7 @@ this.groupBox2.Controls.Add(this.EulerFilter); this.groupBox2.Location = new System.Drawing.Point(265, 12); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(214, 240); + this.groupBox2.Size = new System.Drawing.Size(214, 235); this.groupBox2.TabIndex = 11; this.groupBox2.TabStop = false; this.groupBox2.Text = "Fbx Binary"; @@ -329,8 +327,9 @@ "7.1", "7.2", "7.3", - "7.4"}); - this.fbxVersion.Location = new System.Drawing.Point(77, 200); + "7.4", + "7.5"}); + this.fbxVersion.Location = new System.Drawing.Point(77, 178); this.fbxVersion.Name = "fbxVersion"; this.fbxVersion.Size = new System.Drawing.Size(47, 20); this.fbxVersion.TabIndex = 16; @@ -338,28 +337,16 @@ // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 203); + this.label3.Location = new System.Drawing.Point(6, 181); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(65, 12); this.label3.TabIndex = 15; this.label3.Text = "FBXVersion"; // - // FixRotation - // - this.FixRotation.AutoSize = true; - this.FixRotation.Checked = true; - this.FixRotation.CheckState = System.Windows.Forms.CheckState.Checked; - this.FixRotation.Location = new System.Drawing.Point(6, 20); - this.FixRotation.Name = "FixRotation"; - this.FixRotation.Size = new System.Drawing.Size(90, 16); - this.FixRotation.TabIndex = 14; - this.FixRotation.Text = "FixRotation"; - this.FixRotation.UseVisualStyleBackColor = true; - // // flatInbetween // this.flatInbetween.AutoSize = true; - this.flatInbetween.Location = new System.Drawing.Point(6, 177); + this.flatInbetween.Location = new System.Drawing.Point(6, 155); this.flatInbetween.Name = "flatInbetween"; this.flatInbetween.Size = new System.Drawing.Size(102, 16); this.flatInbetween.TabIndex = 12; @@ -368,7 +355,7 @@ // // boneSize // - this.boneSize.Location = new System.Drawing.Point(65, 150); + this.boneSize.Location = new System.Drawing.Point(65, 128); this.boneSize.Name = "boneSize"; this.boneSize.Size = new System.Drawing.Size(46, 21); this.boneSize.TabIndex = 11; @@ -381,7 +368,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 152); + this.label2.Location = new System.Drawing.Point(6, 130); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(53, 12); this.label2.TabIndex = 10; @@ -392,7 +379,7 @@ this.skins.AutoSize = true; this.skins.Checked = true; this.skins.CheckState = System.Windows.Forms.CheckState.Checked; - this.skins.Location = new System.Drawing.Point(6, 127); + this.skins.Location = new System.Drawing.Point(6, 105); this.skins.Name = "skins"; this.skins.Size = new System.Drawing.Size(54, 16); this.skins.TabIndex = 8; @@ -402,7 +389,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(26, 61); + this.label1.Location = new System.Drawing.Point(26, 39); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(95, 12); this.label1.TabIndex = 7; @@ -416,7 +403,7 @@ 0, 0, 131072}); - this.filterPrecision.Location = new System.Drawing.Point(127, 59); + this.filterPrecision.Location = new System.Drawing.Point(127, 37); this.filterPrecision.Name = "filterPrecision"; this.filterPrecision.Size = new System.Drawing.Size(51, 21); this.filterPrecision.TabIndex = 6; @@ -431,7 +418,7 @@ this.allBones.AutoSize = true; this.allBones.Checked = true; this.allBones.CheckState = System.Windows.Forms.CheckState.Checked; - this.allBones.Location = new System.Drawing.Point(6, 105); + this.allBones.Location = new System.Drawing.Point(6, 83); this.allBones.Name = "allBones"; this.allBones.Size = new System.Drawing.Size(72, 16); this.allBones.TabIndex = 5; @@ -441,7 +428,7 @@ // allFrames // this.allFrames.AutoSize = true; - this.allFrames.Location = new System.Drawing.Point(6, 83); + this.allFrames.Location = new System.Drawing.Point(6, 61); this.allFrames.Name = "allFrames"; this.allFrames.Size = new System.Drawing.Size(78, 16); this.allFrames.TabIndex = 4; @@ -451,7 +438,9 @@ // EulerFilter // this.EulerFilter.AutoSize = true; - this.EulerFilter.Location = new System.Drawing.Point(6, 42); + this.EulerFilter.Checked = true; + this.EulerFilter.CheckState = System.Windows.Forms.CheckState.Checked; + this.EulerFilter.Location = new System.Drawing.Point(6, 20); this.EulerFilter.Name = "EulerFilter"; this.EulerFilter.Size = new System.Drawing.Size(90, 16); this.EulerFilter.TabIndex = 3; @@ -527,7 +516,6 @@ private System.Windows.Forms.CheckBox allBones; private System.Windows.Forms.CheckBox allFrames; private System.Windows.Forms.CheckBox EulerFilter; - private System.Windows.Forms.CheckBox FixRotation; private System.Windows.Forms.Label label3; private System.Windows.Forms.ComboBox fbxVersion; } diff --git a/AssetStudio/ExportOptions.cs b/AssetStudio/ExportOptions.cs index c244494..1217c41 100644 --- a/AssetStudio/ExportOptions.cs +++ b/AssetStudio/ExportOptions.cs @@ -34,7 +34,6 @@ namespace AssetStudio break; } } - FixRotation.Checked = (bool)Properties.Settings.Default["FixRotation"]; EulerFilter.Checked = (bool)Properties.Settings.Default["EulerFilter"]; filterPrecision.Value = (decimal)Properties.Settings.Default["filterPrecision"]; allFrames.Checked = (bool)Properties.Settings.Default["allFrames"]; @@ -69,7 +68,6 @@ namespace AssetStudio break; } } - Properties.Settings.Default["FixRotation"] = FixRotation.Checked; Properties.Settings.Default["EulerFilter"] = EulerFilter.Checked; Properties.Settings.Default["filterPrecision"] = filterPrecision.Value; Properties.Settings.Default["allFrames"] = allFrames.Checked; diff --git a/AssetStudio/Libraries/x64/libfbxsdk.dll b/AssetStudio/Libraries/x64/libfbxsdk.dll index 2604fbc..d4e6a01 100644 Binary files a/AssetStudio/Libraries/x64/libfbxsdk.dll and b/AssetStudio/Libraries/x64/libfbxsdk.dll differ diff --git a/AssetStudio/Libraries/x86/libfbxsdk.dll b/AssetStudio/Libraries/x86/libfbxsdk.dll index 3bce617..656413b 100644 Binary files a/AssetStudio/Libraries/x86/libfbxsdk.dll and b/AssetStudio/Libraries/x86/libfbxsdk.dll differ diff --git a/AssetStudio/Properties/Settings.Designer.cs b/AssetStudio/Properties/Settings.Designer.cs index 209fb6f..aa37c5e 100644 --- a/AssetStudio/Properties/Settings.Designer.cs +++ b/AssetStudio/Properties/Settings.Designer.cs @@ -217,7 +217,7 @@ namespace AssetStudio.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool EulerFilter { get { return ((bool)(this["EulerFilter"])); @@ -310,17 +310,5 @@ namespace AssetStudio.Properties { this["fbxVersion"] = value; } } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool FixRotation { - get { - return ((bool)(this["FixRotation"])); - } - set { - this["FixRotation"] = value; - } - } } } diff --git a/AssetStudio/Properties/Settings.settings b/AssetStudio/Properties/Settings.settings index caf3fe8..36734f3 100644 --- a/AssetStudio/Properties/Settings.settings +++ b/AssetStudio/Properties/Settings.settings @@ -51,7 +51,7 @@ False - False + True 0.25 @@ -74,8 +74,5 @@ 3 - - True - \ No newline at end of file diff --git a/AssetStudio/StudioClasses/ModelConverter.cs b/AssetStudio/StudioClasses/ModelConverter.cs index 81d7548..7dd4b35 100644 --- a/AssetStudio/StudioClasses/ModelConverter.cs +++ b/AssetStudio/StudioClasses/ModelConverter.cs @@ -840,21 +840,6 @@ namespace AssetStudio time2 = animationClip.m_MuscleClip.m_StopTime; } } - - if ((bool)Properties.Settings.Default["FixRotation"]) - { - foreach (var track in iAnim.TrackList) - { - var prevKey = new Vector3(); - foreach (var rotation in track.Rotations) - { - var value = rotation.value; - ReplaceOutOfBound(ref prevKey, ref value); - prevKey = value; - rotation.value = value; - } - } - } } } @@ -999,40 +984,6 @@ namespace AssetStudio } } - private void ReplaceOutOfBound(ref Vector3 prevKey, ref Vector3 curKey) - { - curKey.X = ReplaceOutOfBound(prevKey.X, curKey.X); - curKey.Y = ReplaceOutOfBound(prevKey.Y, curKey.Y); - curKey.Z = ReplaceOutOfBound(prevKey.Z, curKey.Z); - } - - private float ReplaceOutOfBound(float prevValue, float curValue) - { - double prev = prevValue; - double cur = curValue; - - double prevAbs = Math.Abs(prev); - double prevSign = Math.Sign(prev); - - double prevShift = 180.0 + prevAbs; - double count = Math.Floor(prevShift / 360.0) * prevSign; - double prevRemain = 180.0 + (prev - count * 360.0); - - double curShift = 180.0 + cur; - - if (prevRemain - curShift > 180) - { - count++; - } - else if (prevRemain - curShift < -180) - { - count--; - } - - double newValue = count * 360.0 + cur; - return (float)newValue; - } - private void DeoptimizeTransformHierarchy() { if (avatar == null) diff --git a/AssetStudio/app.config b/AssetStudio/app.config index 9f60246..22b3814 100644 --- a/AssetStudio/app.config +++ b/AssetStudio/app.config @@ -56,7 +56,7 @@ False - False + True 0.25 @@ -79,9 +79,6 @@ 3 - - True - \ No newline at end of file diff --git a/AssetStudioFBX/AssetStudioFBX.h b/AssetStudioFBX/AssetStudioFBX.h index fe18faa..cfbf61e 100644 --- a/AssetStudioFBX/AssetStudioFBX.h +++ b/AssetStudioFBX/AssetStudioFBX.h @@ -31,7 +31,8 @@ static char* FBXVersion[] = FBX_2011_00_COMPATIBLE, FBX_2012_00_COMPATIBLE, FBX_2013_00_COMPATIBLE, - FBX_2014_00_COMPATIBLE + FBX_2014_00_COMPATIBLE, + FBX_2016_00_COMPATIBLE }; namespace AssetStudio { diff --git a/AssetStudioFBX/AssetStudioFBX.vcxproj b/AssetStudioFBX/AssetStudioFBX.vcxproj index 4fb34b9..238d3ea 100644 --- a/AssetStudioFBX/AssetStudioFBX.vcxproj +++ b/AssetStudioFBX/AssetStudioFBX.vcxproj @@ -90,11 +90,11 @@ Level3 Disabled FBXSDK_SHARED;_DEBUG;%(PreprocessorDefinitions) - C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\include;%(AdditionalIncludeDirectories) + C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\include;%(AdditionalIncludeDirectories) libfbxsdk.lib;%(AdditionalDependencies) - C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\lib\vs2013\x64\release;%(AdditionalLibraryDirectories) + C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\lib\vs2015\x64\release;%(AdditionalLibraryDirectories) @@ -102,33 +102,33 @@ Level3 Disabled FBXSDK_SHARED;_DEBUG;%(PreprocessorDefinitions) - C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\include;%(AdditionalIncludeDirectories) + C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\include;%(AdditionalIncludeDirectories) libfbxsdk.lib;%(AdditionalDependencies) - C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\lib\vs2013\x86\release;%(AdditionalLibraryDirectories) + C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\lib\vs2015\x86\release;%(AdditionalLibraryDirectories) Level3 FBXSDK_SHARED;NDEBUG;%(PreprocessorDefinitions) - C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\include;%(AdditionalIncludeDirectories) + C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\include;%(AdditionalIncludeDirectories) libfbxsdk.lib;%(AdditionalDependencies) - C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\lib\vs2013\x64\release;%(AdditionalLibraryDirectories) + C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\lib\vs2015\x64\release;%(AdditionalLibraryDirectories) Level3 FBXSDK_SHARED;NDEBUG;%(PreprocessorDefinitions) - C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\include;%(AdditionalIncludeDirectories) + C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\include;%(AdditionalIncludeDirectories) libfbxsdk.lib;%(AdditionalDependencies) - C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\lib\vs2013\x86\release;%(AdditionalLibraryDirectories) + C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\lib\vs2015\x86\release;%(AdditionalLibraryDirectories) diff --git a/AssetStudioFBX/AssetStudioFBXExporter.cpp b/AssetStudioFBX/AssetStudioFBXExporter.cpp index 91cbd60..5bb389f 100644 --- a/AssetStudioFBX/AssetStudioFBXExporter.cpp +++ b/AssetStudioFBX/AssetStudioFBXExporter.cpp @@ -75,11 +75,21 @@ namespace AssetStudio cDest = StringToCharArray(path); pExporter = FbxExporter::Create(pScene, ""); - if (!pExporter->Initialize(cDest, 0, pSdkManager->GetIOSettings())) + + int pFileFormat = 0; + if (versionIndex == 0) + { + pFileFormat = 3; + } + else + { + pExporter->SetFileExportVersion(FBXVersion[versionIndex]); + } + + if (!pExporter->Initialize(cDest, pFileFormat, pSdkManager->GetIOSettings())) { throw gcnew Exception(gcnew String("Failed to initialize FbxExporter: ") + gcnew String(pExporter->GetStatus().GetErrorString())); } - pExporter->SetFileExportVersion(FBXVersion[versionIndex], FbxSceneRenamer::ERenamingMode::eNone); frameNames = nullptr; if (!allFrames) @@ -113,7 +123,7 @@ namespace AssetStudio meshPath = gcnew String(rootNode->GetName()) + "/" + meshPath; } ImportedMesh^ mesh = ImportedHelpers::FindMesh(meshPath, imported->MeshList); - ExportMesh(meshNode, mesh, normals); + ExportMesh(meshNode, mesh, normals); } } else @@ -818,7 +828,6 @@ namespace AssetStudio lCurve[1] = lCurveRY; lCurve[2] = lCurveRZ; EulerFilter->Reset(); - EulerFilter->SetTestForPath(true); EulerFilter->SetQualityTolerance(filterPrecision); EulerFilter->Apply(lCurve, 3); }