mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-26 13:50:21 -04:00
improved & fixed
This commit is contained in:
parent
a1f491af25
commit
d54bfbdfe7
@ -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);
|
||||
}
|
||||
|
44
AssetStudio/ExportOptions.Designer.cs
generated
44
AssetStudio/ExportOptions.Designer.cs
generated
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Binary file not shown.
Binary file not shown.
14
AssetStudio/Properties/Settings.Designer.cs
generated
14
AssetStudio/Properties/Settings.Designer.cs
generated
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="EulerFilter" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="filterPrecision" Type="System.Decimal" Scope="User">
|
||||
<Value Profile="(Default)">0.25</Value>
|
||||
@ -74,8 +74,5 @@
|
||||
<Setting Name="fbxVersion" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">3</Value>
|
||||
</Setting>
|
||||
<Setting Name="FixRotation" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
@ -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)
|
||||
|
@ -56,7 +56,7 @@
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="EulerFilter" serializeAs="String">
|
||||
<value>False</value>
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="filterPrecision" serializeAs="String">
|
||||
<value>0.25</value>
|
||||
@ -79,9 +79,6 @@
|
||||
<setting name="fbxVersion" serializeAs="String">
|
||||
<value>3</value>
|
||||
</setting>
|
||||
<setting name="FixRotation" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
</AssetStudio.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
@ -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 {
|
||||
|
@ -90,11 +90,11 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>FBXSDK_SHARED;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libfbxsdk.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\lib\vs2013\x64\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\lib\vs2015\x64\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
@ -102,33 +102,33 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>FBXSDK_SHARED;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libfbxsdk.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\lib\vs2013\x86\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\lib\vs2015\x86\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>FBXSDK_SHARED;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libfbxsdk.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\lib\vs2013\x64\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\lib\vs2015\x64\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>FBXSDK_SHARED;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libfbxsdk.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2015.1\lib\vs2013\x86\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Autodesk\FBX\FBX SDK\2019.0\lib\vs2015\x86\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user