- [GUI] Improve ExportOptions.

- [GUI] Update Library.
- [GUI] Fix bug in `AssetBrowser`.
This commit is contained in:
Razmoth
2023-11-27 12:30:36 +04:00
parent 445460db62
commit a56b958db5
27 changed files with 510 additions and 475 deletions

View File

@@ -336,8 +336,8 @@ namespace AssetStudio.CLI
}
var m_Animator = (Animator)item.Asset;
var convert = animationList != null
? new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations);
? new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations);
ExportFbx(convert, exportFullPath);
return true;
}
@@ -352,8 +352,8 @@ namespace AssetStudio.CLI
public static bool ExportGameObject(GameObject gameObject, string exportPath, List<AssetItem> animationList = null)
{
var convert = animationList != null
? new ModelConverter(gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations);
? new ModelConverter(gameObject, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(gameObject, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations);
if (convert.MeshList.Count == 0)
{
@@ -377,8 +377,6 @@ namespace AssetStudio.CLI
exportBlendShape = Properties.Settings.Default.exportBlendShape,
castToBone = Properties.Settings.Default.castToBone,
boneSize = (int)Properties.Settings.Default.boneSize,
exportAllUvsAsDiffuseMaps = Properties.Settings.Default.exportAllUvsAsDiffuseMaps,
exportUV0UV1 = Properties.Settings.Default.exportUV0UV1,
scaleFactor = (float)Properties.Settings.Default.scaleFactor,
fbxVersion = Properties.Settings.Default.fbxVersion,
fbxFormat = Properties.Settings.Default.fbxFormat

View File

@@ -43,9 +43,6 @@ namespace AssetStudio.CLI
Logger.Default = new ConsoleLogger();
Logger.FileLogging = Settings.Default.enableFileLogging;
AssetsHelper.Minimal = Settings.Default.minimalAssetMap;
Shader.Parsable = !Settings.Default.disableShader;
Renderer.Parsable = !Settings.Default.disableRenderer;
AnimationClip.Parsable = !Settings.Default.disableAnimationClip;
AssetsHelper.SetUnityVersion(o.UnityVersion);
assetsManager.Silent = o.Silent;

View File

@@ -57,8 +57,6 @@ namespace AssetStudio.CLI.Properties {
public bool exportBlendShape => AppSettings.Get("exportBlendShape", true);
public bool castToBone => AppSettings.Get("castToBone", false);
public bool restoreExtensionName => AppSettings.Get("restoreExtensionName", true);
public bool exportAllUvsAsDiffuseMaps => AppSettings.Get("exportAllUvsAsDiffuseMaps", false);
public bool exportUV0UV1 => AppSettings.Get("exportUV0UV1", false);
public bool encrypted => AppSettings.Get("encrypted", true);
public byte key => AppSettings.Get("key", (byte)0x93);
public int selectedGame => AppSettings.Get("selectedGame", 0);
@@ -66,11 +64,10 @@ namespace AssetStudio.CLI.Properties {
public int selectedCNUnityKey => AppSettings.Get("selectedCNUnityKey", 0);
public int selectedAssetMapType => AppSettings.Get("selectedAssetMapType", 0);
public bool exportMiHoYoBinData => AppSettings.Get("exportMiHoYoBinData", true);
public bool disableShader => AppSettings.Get("disableShader", false);
public bool disableRenderer => AppSettings.Get("disableRenderer", false);
public bool disableAnimationClip => AppSettings.Get("disableAnimationClip", false);
public bool enableFileLogging => AppSettings.Get("enableFileLogging", false);
public bool minimalAssetMap => AppSettings.Get("minimalAssetMap", true);
public string texs => AppSettings.Get("texs", string.Empty);
public string uvs => AppSettings.Get("uvs", string.Empty);
}
}

View File

@@ -332,13 +332,13 @@ namespace AssetStudio.CLI
break;
case Mesh _:
case TextAsset _:
case AnimationClip _ when AnimationClip.Parsable:
case AnimationClip _:
case Font _:
case MovieTexture _:
case Sprite _:
case Material _:
case MiHoYoBinData _:
case Shader _ when Shader.Parsable:
case Shader _:
case Animator _:
exportable = !ModelOnly;
break;

View File

@@ -370,6 +370,18 @@ AS_API(void) AsFbxLinkTexture(int32_t dest, FbxFileTexture* pTexture, FbxSurface
case 3:
pProp = &pMaterial->Bump;
break;
case 4:
pProp = &pMaterial->Ambient;
break;
case 5:
pProp = &pMaterial->Emissive;
break;
case 6:
pProp = &pMaterial->Reflection;
break;
case 7:
pProp = &pMaterial->DisplacementColor;
break;
default:
pProp = nullptr;
break;
@@ -462,26 +474,45 @@ AS_API(void) AsFbxMeshCreateElementNormal(FbxMesh* pMesh)
pNormal->SetReferenceMode(FbxGeometryElement::eDirect);
}
AS_API(void) AsFbxMeshCreateDiffuseUV(FbxMesh* pMesh, int32_t uv)
AS_API(void) AsFbxMeshCreateUV(FbxMesh* pMesh, int32_t uv, int32_t uvType)
{
if (pMesh == nullptr)
{
return;
}
auto pUV = pMesh->CreateElementUV(FbxString("UV") + FbxString(uv), FbxLayerElement::eTextureDiffuse);
pUV->SetMappingMode(FbxGeometryElement::eByControlPoint);
pUV->SetReferenceMode(FbxGeometryElement::eDirect);
}
AS_API(void) AsFbxMeshCreateNormalMapUV(FbxMesh* pMesh, int32_t uv)
{
if (pMesh == nullptr)
{
return;
FbxLayerElement::EType type;
switch (uvType) {
case 0:
type = FbxLayerElement::eTextureDiffuse;
break;
case 1:
type = FbxLayerElement::eTextureNormalMap;
break;
case 2:
type = FbxLayerElement::eTextureSpecular;
break;
case 3:
type = FbxLayerElement::eTextureBump;
break;
case 4:
type = FbxLayerElement::eTextureAmbient;
break;
case 5:
type = FbxLayerElement::eTextureEmissive;
break;
case 6:
type = FbxLayerElement::eTextureReflection;
break;
case 7:
type = FbxLayerElement::eTextureDisplacement;
break;
default:
type = FbxLayerElement::eTextureDiffuse;
break;
}
auto pUV = pMesh->CreateElementUV(FbxString("UV") + FbxString(uv), FbxLayerElement::eTextureNormalMap);
auto pUV = pMesh->CreateElementUV(FbxString("UV") + FbxString(uv), type);
pUV->SetMappingMode(FbxGeometryElement::eByControlPoint);
pUV->SetReferenceMode(FbxGeometryElement::eDirect);
}

View File

@@ -62,8 +62,6 @@ namespace AssetStudio
public bool exportBlendShape;
public bool castToBone;
public int boneSize;
public bool exportAllUvsAsDiffuseMaps;
public bool exportUV0UV1;
public float scaleFactor;
public int fbxVersion;
public int fbxFormat;

View File

@@ -76,10 +76,7 @@ namespace AssetStudio.FbxInterop
private static extern void AsFbxMeshCreateElementNormal(IntPtr mesh);
[DllImport(FbxDll.DllName)]
private static extern void AsFbxMeshCreateDiffuseUV(IntPtr mesh, int uv);
[DllImport(FbxDll.DllName)]
private static extern void AsFbxMeshCreateNormalMapUV(IntPtr mesh, int uv);
private static extern void AsFbxMeshCreateUV(IntPtr mesh, int uv, int uvType);
[DllImport(FbxDll.DllName)]
private static extern void AsFbxMeshCreateElementTangent(IntPtr mesh);

View File

@@ -256,39 +256,12 @@ namespace AssetStudio.FbxInterop
AsFbxMeshCreateElementNormal(mesh);
}
if (_exportOptions.exportUV0UV1)
{
if (importedMesh.hasUV[0])
{
AsFbxMeshCreateDiffuseUV(mesh, 0);
}
if (importedMesh.hasUV[1])
{
if (_exportOptions.exportAllUvsAsDiffuseMaps)
{
AsFbxMeshCreateDiffuseUV(mesh, 1);
}
else
{
AsFbxMeshCreateNormalMapUV(mesh, 1);
}
}
}
else
{
for (int i = 0; i < importedMesh.hasUV.Length; i++)
{
if (!importedMesh.hasUV[i]) { continue; }
if (i == 1 && !_exportOptions.exportAllUvsAsDiffuseMaps)
{
AsFbxMeshCreateNormalMapUV(mesh, 1);
}
else
{
AsFbxMeshCreateDiffuseUV(mesh, i);
}
}
var type = importedMesh.uvType[i];
AsFbxMeshCreateUV(mesh, i, type);
}
if (importedMesh.hasTangent)
@@ -391,7 +364,7 @@ namespace AssetStudio.FbxInterop
AsFbxMeshElementNormalAdd(mesh, 0, normal.X, normal.Y, normal.Z);
}
var uvSize = _exportOptions.exportUV0UV1 ? 2 : importedMesh.hasUV.Length;
var uvSize = importedMesh.hasUV.Length;
for (var uvIndex = 0; uvIndex < uvSize; uvIndex += 1)
{
if (importedMesh.hasUV[uvIndex])

View File

@@ -64,9 +64,6 @@
<setting name="restoreExtensionName" serializeAs="String">
<value>True</value>
</setting>
<setting name="exportAllUvsAsDiffuseMaps" serializeAs="String">
<value>False</value>
</setting>
<setting name="key" serializeAs="String">
<value>147</value>
</setting>
@@ -91,15 +88,6 @@
<setting name="skipContainer" serializeAs="String">
<value>False</value>
</setting>
<setting name="exportUV0UV1" serializeAs="String">
<value>False</value>
</setting>
<setting name="disableShader" serializeAs="String">
<value>False</value>
</setting>
<setting name="disableRenderer" serializeAs="String">
<value>False</value>
</setting>
<setting name="minimalAssetMap" serializeAs="String">
<value>True</value>
</setting>
@@ -115,15 +103,18 @@
<setting name="selectedCABMapName" serializeAs="String">
<value />
</setting>
<setting name="disableAnimationClip" serializeAs="String">
<value>False</value>
</setting>
<setting name="enableFileLogging" serializeAs="String">
<value>True</value>
</setting>
<setting name="enableVerbose" serializeAs="String">
<value>False</value>
</setting>
<setting name="uvs" serializeAs="String">
<value>{"UV0":{"Item1":true,"Item2":0},"UV1":{"Item1":false,"Item2":1},"UV2":{"Item1":true,"Item2":0},"UV3":{"Item1":false,"Item2":0},"UV4":{"Item1":false,"Item2":0},"UV5":{"Item1":false,"Item2":0},"UV6":{"Item1":true,"Item2":0},"UV7":{"Item1":true,"Item2":0}}</value>
</setting>
<setting name="texs" serializeAs="String">
<value>{}</value>
</setting>
</AssetStudio.GUI.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -23,6 +23,8 @@ namespace AssetStudio.GUI
{
InitializeComponent();
_parent = form;
_assetEntries = new List<AssetEntry>();
_columnNames = new List<string>();
}
private async void loadAssetMap_Click(object sender, EventArgs e)
@@ -37,8 +39,11 @@ namespace AssetStudio.GUI
await Task.Run(() => ResourceMap.FromFile(path));
_sortedColumn = null;
_columnNames = typeof(AssetEntry).GetProperties().Select(x => x.Name).ToList();
_assetEntries = ResourceMap.GetEntries();
_columnNames.Clear();
_columnNames.AddRange(typeof(AssetEntry).GetProperties().Select(x => x.Name).ToList());
_assetEntries.Clear();
_assetEntries.AddRange(ResourceMap.GetEntries());
assetDataGridView.Columns.Clear();
assetDataGridView.Columns.AddRange(_columnNames.Select(x => new DataGridViewTextBoxColumn() { Name = x, HeaderText = x, SortMode = DataGridViewColumnSortMode.Programmatic }).ToArray());
@@ -96,9 +101,9 @@ namespace AssetStudio.GUI
filters[name] = new Regex(regex, RegexOptions.IgnoreCase);
}
_assetEntries = ResourceMap.GetEntries().FindAll(x => x.Matches(filters));
_assetEntries.Clear();
_assetEntries.AddRange(ResourceMap.GetEntries().FindAll(x => x.Matches(filters)));
assetDataGridView.CurrentCell = assetDataGridView[0, 0];
assetDataGridView.Rows.Clear();
assetDataGridView.RowCount = _assetEntries.Count;
assetDataGridView.Refresh();
@@ -158,7 +163,8 @@ namespace AssetStudio.GUI
_ => x => ""
};
_assetEntries = direction == ListSortDirection.Ascending ? _assetEntries.OrderBy(keySelector).ToList() : _assetEntries.OrderByDescending(keySelector).ToList();
_assetEntries.Clear();
_assetEntries.AddRange(direction == ListSortDirection.Ascending ? _assetEntries.OrderBy(keySelector).ToList() : _assetEntries.OrderByDescending(keySelector).ToList());
assetDataGridView.CurrentCell = assetDataGridView[0, 0];
assetDataGridView.Rows.Clear();

View File

@@ -1,5 +1,7 @@
using System;
using System.Linq;
using System.Windows.Forms;
using System.Xml.Linq;
namespace AssetStudio.GUI
{
@@ -32,64 +34,75 @@ namespace AssetStudio.GUI
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
OKbutton = new System.Windows.Forms.Button();
Cancel = new System.Windows.Forms.Button();
groupBox1 = new System.Windows.Forms.GroupBox();
assetGroupOptions = new System.Windows.Forms.ComboBox();
label7 = new System.Windows.Forms.Label();
openAfterExport = new System.Windows.Forms.CheckBox();
restoreExtensionName = new System.Windows.Forms.CheckBox();
label6 = new System.Windows.Forms.Label();
convertAudio = new System.Windows.Forms.CheckBox();
panel1 = new System.Windows.Forms.Panel();
totga = new System.Windows.Forms.RadioButton();
tojpg = new System.Windows.Forms.RadioButton();
topng = new System.Windows.Forms.RadioButton();
tobmp = new System.Windows.Forms.RadioButton();
converttexture = new System.Windows.Forms.CheckBox();
collectAnimations = new System.Windows.Forms.CheckBox();
groupBox2 = new System.Windows.Forms.GroupBox();
exportUV0UV1 = new System.Windows.Forms.CheckBox();
exportAllUvsAsDiffuseMaps = new System.Windows.Forms.CheckBox();
exportBlendShape = new System.Windows.Forms.CheckBox();
exportAnimations = new System.Windows.Forms.CheckBox();
scaleFactor = new System.Windows.Forms.NumericUpDown();
label5 = new System.Windows.Forms.Label();
fbxFormat = new System.Windows.Forms.ComboBox();
label4 = new System.Windows.Forms.Label();
fbxVersion = new System.Windows.Forms.ComboBox();
label3 = new System.Windows.Forms.Label();
boneSize = new System.Windows.Forms.NumericUpDown();
label2 = new System.Windows.Forms.Label();
exportSkins = new System.Windows.Forms.CheckBox();
label1 = new System.Windows.Forms.Label();
filterPrecision = new System.Windows.Forms.NumericUpDown();
castToBone = new System.Windows.Forms.CheckBox();
exportAllNodes = new System.Windows.Forms.CheckBox();
eulerFilter = new System.Windows.Forms.CheckBox();
exportUvsTooltip = new System.Windows.Forms.ToolTip(components);
encrypted = new System.Windows.Forms.CheckBox();
key = new System.Windows.Forms.NumericUpDown();
keyToolTip = new System.Windows.Forms.ToolTip(components);
groupBox4 = new System.Windows.Forms.GroupBox();
disableAnimationClip = new System.Windows.Forms.CheckBox();
minimalAssetMap = new System.Windows.Forms.CheckBox();
disableShader = new System.Windows.Forms.CheckBox();
disableRenderer = new System.Windows.Forms.CheckBox();
DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle();
DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
DataGridViewCellStyle dataGridViewCellStyle6 = new DataGridViewCellStyle();
DataGridViewCellStyle dataGridViewCellStyle7 = new DataGridViewCellStyle();
DataGridViewCellStyle dataGridViewCellStyle8 = new DataGridViewCellStyle();
DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
DataGridViewCellStyle dataGridViewCellStyle5 = new DataGridViewCellStyle();
OKbutton = new Button();
Cancel = new Button();
groupBox1 = new GroupBox();
label6 = new Label();
uvsGridView = new DataGridView();
UVName = new DataGridViewTextBoxColumn();
UVEnabled = new DataGridViewCheckBoxColumn();
UVType = new DataGridViewComboBoxColumn();
minimalAssetMap = new CheckBox();
assetGroupOptions = new ComboBox();
label7 = new Label();
openAfterExport = new CheckBox();
restoreExtensionName = new CheckBox();
key = new NumericUpDown();
encrypted = new CheckBox();
convertAudio = new CheckBox();
panel1 = new Panel();
totga = new RadioButton();
tojpg = new RadioButton();
topng = new RadioButton();
tobmp = new RadioButton();
converttexture = new CheckBox();
collectAnimations = new CheckBox();
groupBox2 = new GroupBox();
label9 = new Label();
texsGridView = new DataGridView();
TexName = new DataGridViewTextBoxColumn();
TexType = new DataGridViewComboBoxColumn();
exportBlendShape = new CheckBox();
exportAnimations = new CheckBox();
scaleFactor = new NumericUpDown();
label5 = new Label();
fbxFormat = new ComboBox();
label4 = new Label();
fbxVersion = new ComboBox();
label3 = new Label();
boneSize = new NumericUpDown();
label2 = new Label();
exportSkins = new CheckBox();
label1 = new Label();
filterPrecision = new NumericUpDown();
castToBone = new CheckBox();
exportAllNodes = new CheckBox();
eulerFilter = new CheckBox();
exportUvsTooltip = new ToolTip(components);
keyToolTip = new ToolTip(components);
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)uvsGridView).BeginInit();
((System.ComponentModel.ISupportInitialize)key).BeginInit();
panel1.SuspendLayout();
groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)texsGridView).BeginInit();
((System.ComponentModel.ISupportInitialize)scaleFactor).BeginInit();
((System.ComponentModel.ISupportInitialize)boneSize).BeginInit();
((System.ComponentModel.ISupportInitialize)filterPrecision).BeginInit();
((System.ComponentModel.ISupportInitialize)key).BeginInit();
groupBox4.SuspendLayout();
SuspendLayout();
//
// OKbutton
//
OKbutton.Location = new System.Drawing.Point(371, 439);
OKbutton.Margin = new System.Windows.Forms.Padding(4);
OKbutton.Location = new System.Drawing.Point(480, 439);
OKbutton.Margin = new Padding(4);
OKbutton.Name = "OKbutton";
OKbutton.Size = new System.Drawing.Size(88, 26);
OKbutton.TabIndex = 6;
@@ -99,9 +112,9 @@ namespace AssetStudio.GUI
//
// Cancel
//
Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
Cancel.Location = new System.Drawing.Point(465, 439);
Cancel.Margin = new System.Windows.Forms.Padding(4);
Cancel.DialogResult = DialogResult.Cancel;
Cancel.Location = new System.Drawing.Point(576, 439);
Cancel.Margin = new Padding(4);
Cancel.Name = "Cancel";
Cancel.Size = new System.Drawing.Size(88, 26);
Cancel.TabIndex = 7;
@@ -112,30 +125,90 @@ namespace AssetStudio.GUI
// groupBox1
//
groupBox1.AutoSize = true;
groupBox1.Controls.Add(label6);
groupBox1.Controls.Add(uvsGridView);
groupBox1.Controls.Add(minimalAssetMap);
groupBox1.Controls.Add(assetGroupOptions);
groupBox1.Controls.Add(label7);
groupBox1.Controls.Add(openAfterExport);
groupBox1.Controls.Add(restoreExtensionName);
groupBox1.Controls.Add(label6);
groupBox1.Controls.Add(key);
groupBox1.Controls.Add(encrypted);
groupBox1.Controls.Add(convertAudio);
groupBox1.Controls.Add(panel1);
groupBox1.Controls.Add(converttexture);
groupBox1.Location = new System.Drawing.Point(14, 15);
groupBox1.Margin = new System.Windows.Forms.Padding(4);
groupBox1.Margin = new Padding(4);
groupBox1.Name = "groupBox1";
groupBox1.Padding = new System.Windows.Forms.Padding(4);
groupBox1.Size = new System.Drawing.Size(271, 273);
groupBox1.Padding = new Padding(4);
groupBox1.Size = new System.Drawing.Size(271, 419);
groupBox1.TabIndex = 9;
groupBox1.TabStop = false;
groupBox1.Text = "Export";
//
// label6
//
label6.AutoSize = true;
label6.Location = new System.Drawing.Point(101, 275);
label6.Margin = new Padding(4, 0, 4, 0);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(73, 15);
label6.TabIndex = 27;
label6.Text = "UV Mapping";
//
// uvsGridView
//
uvsGridView.AllowUserToAddRows = false;
uvsGridView.AllowUserToDeleteRows = false;
uvsGridView.AllowUserToResizeRows = false;
uvsGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
uvsGridView.Columns.AddRange(new DataGridViewColumn[] { UVName, UVEnabled, UVType });
uvsGridView.Location = new System.Drawing.Point(8, 293);
uvsGridView.Name = "uvsGridView";
uvsGridView.RowHeadersVisible = false;
dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleCenter;
uvsGridView.RowsDefaultCellStyle = dataGridViewCellStyle1;
uvsGridView.RowTemplate.Height = 25;
uvsGridView.Size = new System.Drawing.Size(255, 103);
uvsGridView.TabIndex = 18;
//
// UVName
//
UVName.HeaderText = "Name";
UVName.Name = "UVName";
UVName.ReadOnly = true;
UVName.Width = 50;
//
// UVEnabled
//
UVEnabled.HeaderText = "Enabled";
UVEnabled.Name = "UVEnabled";
UVEnabled.Width = 60;
//
// UVType
//
UVType.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
UVType.HeaderText = "Type";
UVType.Name = "UVType";
UVType.Items.AddRange(typeMap.Values.ToArray());
//
// minimalAssetMap
//
minimalAssetMap.AutoSize = true;
minimalAssetMap.Location = new System.Drawing.Point(7, 129);
minimalAssetMap.Name = "minimalAssetMap";
minimalAssetMap.Size = new System.Drawing.Size(125, 19);
minimalAssetMap.TabIndex = 17;
minimalAssetMap.Text = "Minimal AssetMap";
minimalAssetMap.UseVisualStyleBackColor = true;
//
// assetGroupOptions
//
assetGroupOptions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
assetGroupOptions.DropDownStyle = ComboBoxStyle.DropDownList;
assetGroupOptions.FormattingEnabled = true;
assetGroupOptions.Items.AddRange(new object[] { "type name", "container path", "source file name", "do not group" });
assetGroupOptions.Location = new System.Drawing.Point(7, 83);
assetGroupOptions.Margin = new System.Windows.Forms.Padding(4);
assetGroupOptions.Location = new System.Drawing.Point(8, 241);
assetGroupOptions.Margin = new Padding(4);
assetGroupOptions.Name = "assetGroupOptions";
assetGroupOptions.Size = new System.Drawing.Size(173, 23);
assetGroupOptions.TabIndex = 12;
@@ -143,8 +216,8 @@ namespace AssetStudio.GUI
// label7
//
label7.AutoSize = true;
label7.Location = new System.Drawing.Point(7, 64);
label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label7.Location = new System.Drawing.Point(8, 222);
label7.Margin = new Padding(4, 0, 4, 0);
label7.Name = "label7";
label7.Size = new System.Drawing.Size(140, 15);
label7.TabIndex = 11;
@@ -154,9 +227,9 @@ namespace AssetStudio.GUI
//
openAfterExport.AutoSize = true;
openAfterExport.Checked = true;
openAfterExport.CheckState = System.Windows.Forms.CheckState.Checked;
openAfterExport.Location = new System.Drawing.Point(8, 230);
openAfterExport.Margin = new System.Windows.Forms.Padding(4);
openAfterExport.CheckState = CheckState.Checked;
openAfterExport.Location = new System.Drawing.Point(7, 78);
openAfterExport.Margin = new Padding(4);
openAfterExport.Name = "openAfterExport";
openAfterExport.Size = new System.Drawing.Size(153, 19);
openAfterExport.TabIndex = 10;
@@ -167,32 +240,46 @@ namespace AssetStudio.GUI
//
restoreExtensionName.AutoSize = true;
restoreExtensionName.Checked = true;
restoreExtensionName.CheckState = System.Windows.Forms.CheckState.Checked;
restoreExtensionName.Location = new System.Drawing.Point(7, 109);
restoreExtensionName.Margin = new System.Windows.Forms.Padding(4);
restoreExtensionName.CheckState = CheckState.Checked;
restoreExtensionName.Location = new System.Drawing.Point(7, 24);
restoreExtensionName.Margin = new Padding(4);
restoreExtensionName.Name = "restoreExtensionName";
restoreExtensionName.Size = new System.Drawing.Size(204, 19);
restoreExtensionName.TabIndex = 9;
restoreExtensionName.Text = "Restore TextAsset extension name";
restoreExtensionName.UseVisualStyleBackColor = true;
//
// label6
// key
//
label6.AutoSize = true;
label6.Location = new System.Drawing.Point(7, 21);
label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(80, 15);
label6.TabIndex = 7;
label6.Text = "Group exported assets by";
key.Hexadecimal = true;
key.Location = new System.Drawing.Point(186, 103);
key.Margin = new Padding(4, 3, 4, 3);
key.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
key.Name = "key";
key.Size = new System.Drawing.Size(55, 23);
key.TabIndex = 8;
keyToolTip.SetToolTip(key, "Key in hex");
//
// encrypted
//
encrypted.AutoSize = true;
encrypted.Checked = true;
encrypted.CheckState = CheckState.Checked;
encrypted.Location = new System.Drawing.Point(7, 104);
encrypted.Margin = new Padding(4, 3, 4, 3);
encrypted.Name = "encrypted";
encrypted.Size = new System.Drawing.Size(166, 19);
encrypted.TabIndex = 12;
encrypted.Text = "Encrypted MiHoYoBinData\r\n";
encrypted.UseVisualStyleBackColor = true;
//
// convertAudio
//
convertAudio.AutoSize = true;
convertAudio.Checked = true;
convertAudio.CheckState = System.Windows.Forms.CheckState.Checked;
convertAudio.Location = new System.Drawing.Point(7, 204);
convertAudio.Margin = new System.Windows.Forms.Padding(4);
convertAudio.CheckState = CheckState.Checked;
convertAudio.Location = new System.Drawing.Point(7, 51);
convertAudio.Margin = new Padding(4);
convertAudio.Name = "convertAudio";
convertAudio.Size = new System.Drawing.Size(200, 19);
convertAudio.TabIndex = 6;
@@ -205,8 +292,8 @@ namespace AssetStudio.GUI
panel1.Controls.Add(tojpg);
panel1.Controls.Add(topng);
panel1.Controls.Add(tobmp);
panel1.Location = new System.Drawing.Point(23, 164);
panel1.Margin = new System.Windows.Forms.Padding(4);
panel1.Location = new System.Drawing.Point(18, 180);
panel1.Margin = new Padding(4);
panel1.Name = "panel1";
panel1.Size = new System.Drawing.Size(236, 38);
panel1.TabIndex = 5;
@@ -215,7 +302,7 @@ namespace AssetStudio.GUI
//
totga.AutoSize = true;
totga.Location = new System.Drawing.Point(175, 8);
totga.Margin = new System.Windows.Forms.Padding(4);
totga.Margin = new Padding(4);
totga.Name = "totga";
totga.Size = new System.Drawing.Size(43, 19);
totga.TabIndex = 2;
@@ -226,7 +313,7 @@ namespace AssetStudio.GUI
//
tojpg.AutoSize = true;
tojpg.Location = new System.Drawing.Point(113, 8);
tojpg.Margin = new System.Windows.Forms.Padding(4);
tojpg.Margin = new Padding(4);
tojpg.Name = "tojpg";
tojpg.Size = new System.Drawing.Size(49, 19);
tojpg.TabIndex = 4;
@@ -238,7 +325,7 @@ namespace AssetStudio.GUI
topng.AutoSize = true;
topng.Checked = true;
topng.Location = new System.Drawing.Point(58, 8);
topng.Margin = new System.Windows.Forms.Padding(4);
topng.Margin = new Padding(4);
topng.Name = "topng";
topng.Size = new System.Drawing.Size(46, 19);
topng.TabIndex = 3;
@@ -250,7 +337,7 @@ namespace AssetStudio.GUI
//
tobmp.AutoSize = true;
tobmp.Location = new System.Drawing.Point(4, 8);
tobmp.Margin = new System.Windows.Forms.Padding(4);
tobmp.Margin = new Padding(4);
tobmp.Name = "tobmp";
tobmp.Size = new System.Drawing.Size(50, 19);
tobmp.TabIndex = 2;
@@ -261,9 +348,9 @@ namespace AssetStudio.GUI
//
converttexture.AutoSize = true;
converttexture.Checked = true;
converttexture.CheckState = System.Windows.Forms.CheckState.Checked;
converttexture.Location = new System.Drawing.Point(7, 136);
converttexture.Margin = new System.Windows.Forms.Padding(4);
converttexture.CheckState = CheckState.Checked;
converttexture.Location = new System.Drawing.Point(7, 153);
converttexture.Margin = new Padding(4);
converttexture.Name = "converttexture";
converttexture.Size = new System.Drawing.Size(123, 19);
converttexture.TabIndex = 1;
@@ -274,9 +361,9 @@ namespace AssetStudio.GUI
//
collectAnimations.AutoSize = true;
collectAnimations.Checked = true;
collectAnimations.CheckState = System.Windows.Forms.CheckState.Checked;
collectAnimations.Location = new System.Drawing.Point(8, 113);
collectAnimations.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
collectAnimations.CheckState = CheckState.Checked;
collectAnimations.Location = new System.Drawing.Point(8, 43);
collectAnimations.Margin = new Padding(4, 3, 4, 3);
collectAnimations.Name = "collectAnimations";
collectAnimations.Size = new System.Drawing.Size(125, 19);
collectAnimations.TabIndex = 24;
@@ -286,9 +373,9 @@ namespace AssetStudio.GUI
// groupBox2
//
groupBox2.AutoSize = true;
groupBox2.Controls.Add(exportUV0UV1);
groupBox2.Controls.Add(label9);
groupBox2.Controls.Add(texsGridView);
groupBox2.Controls.Add(collectAnimations);
groupBox2.Controls.Add(exportAllUvsAsDiffuseMaps);
groupBox2.Controls.Add(exportBlendShape);
groupBox2.Controls.Add(exportAnimations);
groupBox2.Controls.Add(scaleFactor);
@@ -306,47 +393,90 @@ namespace AssetStudio.GUI
groupBox2.Controls.Add(exportAllNodes);
groupBox2.Controls.Add(eulerFilter);
groupBox2.Location = new System.Drawing.Point(292, 15);
groupBox2.Margin = new System.Windows.Forms.Padding(4);
groupBox2.Margin = new Padding(4);
groupBox2.Name = "groupBox2";
groupBox2.Padding = new System.Windows.Forms.Padding(4);
groupBox2.Size = new System.Drawing.Size(261, 418);
groupBox2.Padding = new Padding(4);
groupBox2.Size = new System.Drawing.Size(379, 419);
groupBox2.TabIndex = 11;
groupBox2.TabStop = false;
groupBox2.Text = "Fbx";
//
// exportUV0UV1
// label9
//
exportUV0UV1.AccessibleDescription = "";
exportUV0UV1.AutoSize = true;
exportUV0UV1.Location = new System.Drawing.Point(8, 243);
exportUV0UV1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
exportUV0UV1.Name = "exportUV0UV1";
exportUV0UV1.Size = new System.Drawing.Size(124, 19);
exportUV0UV1.TabIndex = 25;
exportUV0UV1.Text = "Export UV 0/1 only";
exportUvsTooltip.SetToolTip(exportUV0UV1, "Unchecked: Export UV0/UV1 only. Check this if your facing issues with vertex color/tangent.");
exportUV0UV1.UseVisualStyleBackColor = true;
label9.AutoSize = true;
label9.Location = new System.Drawing.Point(133, 230);
label9.Margin = new Padding(4, 0, 4, 0);
label9.Name = "label9";
label9.Size = new System.Drawing.Size(96, 15);
label9.TabIndex = 28;
label9.Text = "Texture Mapping";
//
// exportAllUvsAsDiffuseMaps
// texsGridView
//
exportAllUvsAsDiffuseMaps.AccessibleDescription = "";
exportAllUvsAsDiffuseMaps.AutoSize = true;
exportAllUvsAsDiffuseMaps.Location = new System.Drawing.Point(8, 217);
exportAllUvsAsDiffuseMaps.Margin = new System.Windows.Forms.Padding(4);
exportAllUvsAsDiffuseMaps.Name = "exportAllUvsAsDiffuseMaps";
exportAllUvsAsDiffuseMaps.Size = new System.Drawing.Size(183, 19);
exportAllUvsAsDiffuseMaps.TabIndex = 23;
exportAllUvsAsDiffuseMaps.Text = "Export all UVs as diffuse maps";
exportUvsTooltip.SetToolTip(exportAllUvsAsDiffuseMaps, "Unchecked: UV1 exported as normal map. Check this if your export is missing a UV map.");
exportAllUvsAsDiffuseMaps.UseVisualStyleBackColor = true;
texsGridView.AllowUserToResizeColumns = false;
texsGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleCenter;
texsGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = DataGridViewTriState.True;
texsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
texsGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
texsGridView.Columns.AddRange(new DataGridViewColumn[] { TexName, TexType });
dataGridViewCellStyle6.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle6.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle6.WrapMode = DataGridViewTriState.False;
texsGridView.DefaultCellStyle = dataGridViewCellStyle6;
texsGridView.Location = new System.Drawing.Point(7, 248);
texsGridView.Name = "texsGridView";
dataGridViewCellStyle7.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = DataGridViewTriState.True;
texsGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle7;
texsGridView.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dataGridViewCellStyle8.Alignment = DataGridViewContentAlignment.MiddleCenter;
texsGridView.RowsDefaultCellStyle = dataGridViewCellStyle8;
texsGridView.RowTemplate.Height = 25;
texsGridView.Size = new System.Drawing.Size(365, 148);
texsGridView.TabIndex = 27;
//
// TexName
//
TexName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
dataGridViewCellStyle4.Alignment = DataGridViewContentAlignment.MiddleCenter;
TexName.DefaultCellStyle = dataGridViewCellStyle4;
TexName.HeaderText = "Name";
TexName.Name = "TexName";
TexName.Resizable = DataGridViewTriState.False;
//
// TexType
//
dataGridViewCellStyle5.Alignment = DataGridViewContentAlignment.MiddleCenter;
TexType.DefaultCellStyle = dataGridViewCellStyle5;
TexType.HeaderText = "Type";
TexType.Name = "TexType";
TexType.Items.AddRange(typeMap.Values.ToArray());
TexType.Resizable = DataGridViewTriState.False;
//
// exportBlendShape
//
exportBlendShape.AutoSize = true;
exportBlendShape.Checked = true;
exportBlendShape.CheckState = System.Windows.Forms.CheckState.Checked;
exportBlendShape.Location = new System.Drawing.Point(8, 163);
exportBlendShape.Margin = new System.Windows.Forms.Padding(4);
exportBlendShape.CheckState = CheckState.Checked;
exportBlendShape.Location = new System.Drawing.Point(7, 69);
exportBlendShape.Margin = new Padding(4);
exportBlendShape.Name = "exportBlendShape";
exportBlendShape.Size = new System.Drawing.Size(124, 19);
exportBlendShape.TabIndex = 22;
@@ -357,9 +487,9 @@ namespace AssetStudio.GUI
//
exportAnimations.AutoSize = true;
exportAnimations.Checked = true;
exportAnimations.CheckState = System.Windows.Forms.CheckState.Checked;
exportAnimations.Location = new System.Drawing.Point(8, 136);
exportAnimations.Margin = new System.Windows.Forms.Padding(4);
exportAnimations.CheckState = CheckState.Checked;
exportAnimations.Location = new System.Drawing.Point(154, 43);
exportAnimations.Margin = new Padding(4);
exportAnimations.Name = "exportAnimations";
exportAnimations.Size = new System.Drawing.Size(122, 19);
exportAnimations.TabIndex = 21;
@@ -370,19 +500,19 @@ namespace AssetStudio.GUI
//
scaleFactor.DecimalPlaces = 2;
scaleFactor.Increment = new decimal(new int[] { 1, 0, 0, 131072 });
scaleFactor.Location = new System.Drawing.Point(98, 305);
scaleFactor.Margin = new System.Windows.Forms.Padding(4);
scaleFactor.Location = new System.Drawing.Point(103, 185);
scaleFactor.Margin = new Padding(4);
scaleFactor.Name = "scaleFactor";
scaleFactor.Size = new System.Drawing.Size(70, 23);
scaleFactor.Size = new System.Drawing.Size(59, 23);
scaleFactor.TabIndex = 20;
scaleFactor.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
scaleFactor.TextAlign = HorizontalAlignment.Center;
scaleFactor.Value = new decimal(new int[] { 1, 0, 0, 0 });
//
// label5
//
label5.AutoSize = true;
label5.Location = new System.Drawing.Point(8, 307);
label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label5.Location = new System.Drawing.Point(9, 189);
label5.Margin = new Padding(4, 0, 4, 0);
label5.Name = "label5";
label5.Size = new System.Drawing.Size(67, 15);
label5.TabIndex = 19;
@@ -390,11 +520,11 @@ namespace AssetStudio.GUI
//
// fbxFormat
//
fbxFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
fbxFormat.DropDownStyle = ComboBoxStyle.DropDownList;
fbxFormat.FormattingEnabled = true;
fbxFormat.Items.AddRange(new object[] { "Binary", "Ascii" });
fbxFormat.Location = new System.Drawing.Point(91, 339);
fbxFormat.Margin = new System.Windows.Forms.Padding(4);
fbxFormat.Location = new System.Drawing.Point(272, 121);
fbxFormat.Margin = new Padding(4);
fbxFormat.Name = "fbxFormat";
fbxFormat.Size = new System.Drawing.Size(70, 23);
fbxFormat.TabIndex = 18;
@@ -402,8 +532,8 @@ namespace AssetStudio.GUI
// label4
//
label4.AutoSize = true;
label4.Location = new System.Drawing.Point(8, 343);
label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label4.Location = new System.Drawing.Point(189, 125);
label4.Margin = new Padding(4, 0, 4, 0);
label4.Name = "label4";
label4.Size = new System.Drawing.Size(65, 15);
label4.TabIndex = 17;
@@ -411,20 +541,20 @@ namespace AssetStudio.GUI
//
// fbxVersion
//
fbxVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
fbxVersion.DropDownStyle = ComboBoxStyle.DropDownList;
fbxVersion.FormattingEnabled = true;
fbxVersion.Items.AddRange(new object[] { "6.1", "7.1", "7.2", "7.3", "7.4", "7.5" });
fbxVersion.Location = new System.Drawing.Point(91, 371);
fbxVersion.Margin = new System.Windows.Forms.Padding(4);
fbxVersion.Location = new System.Drawing.Point(272, 153);
fbxVersion.Margin = new Padding(4);
fbxVersion.Name = "fbxVersion";
fbxVersion.Size = new System.Drawing.Size(54, 23);
fbxVersion.Size = new System.Drawing.Size(70, 23);
fbxVersion.TabIndex = 16;
//
// label3
//
label3.AutoSize = true;
label3.Location = new System.Drawing.Point(8, 375);
label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label3.Location = new System.Drawing.Point(189, 157);
label3.Margin = new Padding(4, 0, 4, 0);
label3.Name = "label3";
label3.Size = new System.Drawing.Size(65, 15);
label3.TabIndex = 15;
@@ -432,18 +562,18 @@ namespace AssetStudio.GUI
//
// boneSize
//
boneSize.Location = new System.Drawing.Point(77, 270);
boneSize.Margin = new System.Windows.Forms.Padding(4);
boneSize.Location = new System.Drawing.Point(103, 153);
boneSize.Margin = new Padding(4);
boneSize.Name = "boneSize";
boneSize.Size = new System.Drawing.Size(54, 23);
boneSize.Size = new System.Drawing.Size(59, 23);
boneSize.TabIndex = 11;
boneSize.Value = new decimal(new int[] { 10, 0, 0, 0 });
//
// label2
//
label2.AutoSize = true;
label2.Location = new System.Drawing.Point(8, 272);
label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label2.Location = new System.Drawing.Point(9, 157);
label2.Margin = new Padding(4, 0, 4, 0);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(54, 15);
label2.TabIndex = 10;
@@ -453,9 +583,9 @@ namespace AssetStudio.GUI
//
exportSkins.AutoSize = true;
exportSkins.Checked = true;
exportSkins.CheckState = System.Windows.Forms.CheckState.Checked;
exportSkins.Location = new System.Drawing.Point(8, 87);
exportSkins.Margin = new System.Windows.Forms.Padding(4);
exportSkins.CheckState = CheckState.Checked;
exportSkins.Location = new System.Drawing.Point(94, 17);
exportSkins.Margin = new Padding(4);
exportSkins.Name = "exportSkins";
exportSkins.Size = new System.Drawing.Size(89, 19);
exportSkins.TabIndex = 8;
@@ -465,8 +595,8 @@ namespace AssetStudio.GUI
// label1
//
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(31, 41);
label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label1.Location = new System.Drawing.Point(9, 125);
label1.Margin = new Padding(4, 0, 4, 0);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(81, 15);
label1.TabIndex = 7;
@@ -476,8 +606,8 @@ namespace AssetStudio.GUI
//
filterPrecision.DecimalPlaces = 2;
filterPrecision.Increment = new decimal(new int[] { 1, 0, 0, 131072 });
filterPrecision.Location = new System.Drawing.Point(149, 38);
filterPrecision.Margin = new System.Windows.Forms.Padding(4);
filterPrecision.Location = new System.Drawing.Point(103, 123);
filterPrecision.Margin = new Padding(4);
filterPrecision.Name = "filterPrecision";
filterPrecision.Size = new System.Drawing.Size(59, 23);
filterPrecision.TabIndex = 6;
@@ -486,8 +616,8 @@ namespace AssetStudio.GUI
// castToBone
//
castToBone.AutoSize = true;
castToBone.Location = new System.Drawing.Point(8, 190);
castToBone.Margin = new System.Windows.Forms.Padding(4);
castToBone.Location = new System.Drawing.Point(154, 69);
castToBone.Margin = new Padding(4);
castToBone.Name = "castToBone";
castToBone.Size = new System.Drawing.Size(143, 19);
castToBone.TabIndex = 5;
@@ -498,9 +628,9 @@ namespace AssetStudio.GUI
//
exportAllNodes.AutoSize = true;
exportAllNodes.Checked = true;
exportAllNodes.CheckState = System.Windows.Forms.CheckState.Checked;
exportAllNodes.Location = new System.Drawing.Point(8, 60);
exportAllNodes.Margin = new System.Windows.Forms.Padding(4);
exportAllNodes.CheckState = CheckState.Checked;
exportAllNodes.Location = new System.Drawing.Point(191, 17);
exportAllNodes.Margin = new Padding(4);
exportAllNodes.Name = "exportAllNodes";
exportAllNodes.Size = new System.Drawing.Size(110, 19);
exportAllNodes.TabIndex = 4;
@@ -511,133 +641,48 @@ namespace AssetStudio.GUI
//
eulerFilter.AutoSize = true;
eulerFilter.Checked = true;
eulerFilter.CheckState = System.Windows.Forms.CheckState.Checked;
eulerFilter.CheckState = CheckState.Checked;
eulerFilter.Location = new System.Drawing.Point(8, 17);
eulerFilter.Margin = new System.Windows.Forms.Padding(4);
eulerFilter.Margin = new Padding(4);
eulerFilter.Name = "eulerFilter";
eulerFilter.Size = new System.Drawing.Size(78, 19);
eulerFilter.TabIndex = 3;
eulerFilter.Text = "EulerFilter";
eulerFilter.UseVisualStyleBackColor = true;
//
// encrypted
//
encrypted.AutoSize = true;
encrypted.Checked = true;
encrypted.CheckState = System.Windows.Forms.CheckState.Checked;
encrypted.Location = new System.Drawing.Point(8, 22);
encrypted.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
encrypted.Name = "encrypted";
encrypted.Size = new System.Drawing.Size(166, 19);
encrypted.TabIndex = 12;
encrypted.Text = "Encrypted MiHoYoBinData\r\n";
encrypted.UseVisualStyleBackColor = true;
//
// key
//
key.Hexadecimal = true;
key.Location = new System.Drawing.Point(199, 18);
key.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
key.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
key.Name = "key";
key.Size = new System.Drawing.Size(55, 23);
key.TabIndex = 8;
keyToolTip.SetToolTip(key, "Key in hex");
//
// groupBox4
//
groupBox4.AutoSize = true;
groupBox4.Controls.Add(disableAnimationClip);
groupBox4.Controls.Add(minimalAssetMap);
groupBox4.Controls.Add(disableShader);
groupBox4.Controls.Add(disableRenderer);
groupBox4.Controls.Add(key);
groupBox4.Controls.Add(encrypted);
groupBox4.Location = new System.Drawing.Point(13, 287);
groupBox4.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
groupBox4.Name = "groupBox4";
groupBox4.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
groupBox4.Size = new System.Drawing.Size(272, 146);
groupBox4.TabIndex = 13;
groupBox4.TabStop = false;
groupBox4.Text = "Options";
//
// disableAnimationClip
//
disableAnimationClip.AutoSize = true;
disableAnimationClip.Location = new System.Drawing.Point(119, 72);
disableAnimationClip.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
disableAnimationClip.Name = "disableAnimationClip";
disableAnimationClip.Size = new System.Drawing.Size(144, 19);
disableAnimationClip.TabIndex = 18;
disableAnimationClip.Text = "Disable AnimationClip";
disableAnimationClip.UseVisualStyleBackColor = true;
//
// minimalAssetMap
//
minimalAssetMap.AutoSize = true;
minimalAssetMap.Location = new System.Drawing.Point(8, 97);
minimalAssetMap.Name = "minimalAssetMap";
minimalAssetMap.Size = new System.Drawing.Size(125, 19);
minimalAssetMap.TabIndex = 17;
minimalAssetMap.Text = "Minimal AssetMap";
minimalAssetMap.UseVisualStyleBackColor = true;
//
// disableShader
//
disableShader.AutoSize = true;
disableShader.Location = new System.Drawing.Point(8, 72);
disableShader.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
disableShader.Name = "disableShader";
disableShader.Size = new System.Drawing.Size(103, 19);
disableShader.TabIndex = 16;
disableShader.Text = "Disable Shader";
disableShader.UseVisualStyleBackColor = true;
//
// disableRenderer
//
disableRenderer.AutoSize = true;
disableRenderer.Location = new System.Drawing.Point(8, 47);
disableRenderer.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
disableRenderer.Name = "disableRenderer";
disableRenderer.Size = new System.Drawing.Size(114, 19);
disableRenderer.TabIndex = 15;
disableRenderer.Text = "Disable Renderer";
disableRenderer.UseVisualStyleBackColor = true;
//
// ExportOptions
//
AcceptButton = OKbutton;
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
AutoScaleMode = AutoScaleMode.Font;
CancelButton = Cancel;
ClientSize = new System.Drawing.Size(567, 480);
Controls.Add(groupBox4);
ClientSize = new System.Drawing.Size(677, 480);
Controls.Add(groupBox2);
Controls.Add(groupBox1);
Controls.Add(Cancel);
Controls.Add(OKbutton);
Margin = new System.Windows.Forms.Padding(4);
FormBorderStyle = FormBorderStyle.Fixed3D;
Margin = new Padding(4);
MaximizeBox = false;
MinimizeBox = false;
Name = "ExportOptions";
ShowIcon = false;
ShowInTaskbar = false;
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
StartPosition = FormStartPosition.CenterScreen;
Text = "Export options";
TopMost = true;
groupBox1.ResumeLayout(false);
groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)uvsGridView).EndInit();
((System.ComponentModel.ISupportInitialize)key).EndInit();
panel1.ResumeLayout(false);
panel1.PerformLayout();
groupBox2.ResumeLayout(false);
groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)texsGridView).EndInit();
((System.ComponentModel.ISupportInitialize)scaleFactor).EndInit();
((System.ComponentModel.ISupportInitialize)boneSize).EndInit();
((System.ComponentModel.ISupportInitialize)filterPrecision).EndInit();
((System.ComponentModel.ISupportInitialize)key).EndInit();
groupBox4.ResumeLayout(false);
groupBox4.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
@@ -671,21 +716,23 @@ namespace AssetStudio.GUI
private System.Windows.Forms.CheckBox exportBlendShape;
private System.Windows.Forms.CheckBox exportAnimations;
private System.Windows.Forms.ComboBox assetGroupOptions;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.CheckBox restoreExtensionName;
private System.Windows.Forms.CheckBox openAfterExport;
private System.Windows.Forms.CheckBox exportAllUvsAsDiffuseMaps;
private System.Windows.Forms.ToolTip exportUvsTooltip;
private System.Windows.Forms.CheckBox collectAnimations;
private System.Windows.Forms.CheckBox encrypted;
private System.Windows.Forms.NumericUpDown key;
private System.Windows.Forms.ToolTip keyToolTip;
private System.Windows.Forms.CheckBox exportUV0UV1;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.CheckBox disableShader;
private System.Windows.Forms.CheckBox disableRenderer;
private System.Windows.Forms.CheckBox minimalAssetMap;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.CheckBox disableAnimationClip;
private System.Windows.Forms.DataGridView texsGridView;
private Label label9;
private DataGridViewTextBoxColumn TexName;
private DataGridViewComboBoxColumn TexType;
private Label label6;
private DataGridView uvsGridView;
private DataGridViewTextBoxColumn UVName;
private DataGridViewCheckBoxColumn UVEnabled;
private DataGridViewComboBoxColumn UVType;
}
}

View File

@@ -1,5 +1,4 @@
using AssetStudio;
using Newtonsoft.Json;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,6 +8,17 @@ namespace AssetStudio.GUI
{
public partial class ExportOptions : Form
{
private Dictionary<int, string> typeMap = new Dictionary<int, string>()
{
{ 0, "Diffuse" },
{ 1, "NormalMap" },
{ 2, "Specular" },
{ 3, "Bump" },
{ 4, "Ambient" },
{ 5, "Emissive" },
{ 6, "Reflection" },
{ 7, "Displacement" },
};
public ExportOptions()
{
InitializeComponent();
@@ -33,8 +43,6 @@ namespace AssetStudio.GUI
exportAnimations.Checked = Properties.Settings.Default.exportAnimations;
exportBlendShape.Checked = Properties.Settings.Default.exportBlendShape;
castToBone.Checked = Properties.Settings.Default.castToBone;
exportAllUvsAsDiffuseMaps.Checked = Properties.Settings.Default.exportAllUvsAsDiffuseMaps;
exportUV0UV1.Checked = Properties.Settings.Default.exportUV0UV1;
boneSize.Value = Properties.Settings.Default.boneSize;
scaleFactor.Value = Properties.Settings.Default.scaleFactor;
fbxVersion.SelectedIndex = Properties.Settings.Default.fbxVersion;
@@ -42,10 +50,24 @@ namespace AssetStudio.GUI
collectAnimations.Checked = Properties.Settings.Default.collectAnimations;
encrypted.Checked = Properties.Settings.Default.encrypted;
key.Value = Properties.Settings.Default.key;
disableRenderer.Checked = Properties.Settings.Default.disableRenderer;
disableShader.Checked = Properties.Settings.Default.disableShader;
disableAnimationClip.Checked = Properties.Settings.Default.disableAnimationClip;
minimalAssetMap.Checked = Properties.Settings.Default.minimalAssetMap;
var uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs);
foreach (var uv in uvs)
{
var rowIdx = uvsGridView.Rows.Add();
uvsGridView.Rows[rowIdx].Cells["UVName"].Value = uv.Key;
uvsGridView.Rows[rowIdx].Cells["UVEnabled"].Value = uv.Value.Item1;
uvsGridView.Rows[rowIdx].Cells["UVType"].Value = typeMap[uv.Value.Item2];
}
var texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs);
foreach (var tex in texs)
{
var rowIdx = texsGridView.Rows.Add();
texsGridView.Rows[rowIdx].Cells["TexName"].Value = tex.Key;
texsGridView.Rows[rowIdx].Cells["TexType"].Value = typeMap[tex.Value];
}
}
private void OKbutton_Click(object sender, EventArgs e)
@@ -70,8 +92,6 @@ namespace AssetStudio.GUI
Properties.Settings.Default.exportAnimations = exportAnimations.Checked;
Properties.Settings.Default.exportBlendShape = exportBlendShape.Checked;
Properties.Settings.Default.castToBone = castToBone.Checked;
Properties.Settings.Default.exportAllUvsAsDiffuseMaps = exportAllUvsAsDiffuseMaps.Checked;
Properties.Settings.Default.exportUV0UV1 = exportUV0UV1.Checked;
Properties.Settings.Default.boneSize = boneSize.Value;
Properties.Settings.Default.scaleFactor = scaleFactor.Value;
Properties.Settings.Default.fbxVersion = fbxVersion.SelectedIndex;
@@ -79,17 +99,30 @@ namespace AssetStudio.GUI
Properties.Settings.Default.collectAnimations = collectAnimations.Checked;
Properties.Settings.Default.encrypted = encrypted.Checked;
Properties.Settings.Default.key = (byte)key.Value;
Properties.Settings.Default.disableRenderer = disableRenderer.Checked;
Properties.Settings.Default.disableShader = disableShader.Checked;
Properties.Settings.Default.disableAnimationClip = disableAnimationClip.Checked;
Properties.Settings.Default.minimalAssetMap = minimalAssetMap.Checked;
var uvs = new Dictionary<string, (bool, int)>();
foreach (DataGridViewRow row in uvsGridView.Rows)
{
var name = row.Cells["UVName"].Value as string;
var enabled = (bool)row.Cells["UVEnabled"].Value;
var type = row.Cells["UVType"].Value as string;
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(type)) continue;
uvs.Add(name, (enabled, typeMap.FirstOrDefault(x => x.Value == type).Key));
}
Properties.Settings.Default.uvs = JsonConvert.SerializeObject(uvs);
var texs = new Dictionary<string, int>();
foreach (DataGridViewRow row in texsGridView.Rows)
{
var name = row.Cells["TexName"].Value as string;
var type = row.Cells["TexType"].Value as string;
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(type)) continue;
texs.Add(name, typeMap.FirstOrDefault(x => x.Value == type).Key);
}
Properties.Settings.Default.texs = JsonConvert.SerializeObject(texs);
Properties.Settings.Default.Save();
MiHoYoBinData.Key = (byte)key.Value;
MiHoYoBinData.Encrypted = encrypted.Checked;
AssetsHelper.Minimal = Properties.Settings.Default.minimalAssetMap;
Renderer.Parsable = !Properties.Settings.Default.disableRenderer;
Shader.Parsable = !Properties.Settings.Default.disableShader;
AnimationClip.Parsable = !Properties.Settings.Default.disableAnimationClip;
DialogResult = DialogResult.OK;
Close();
}

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
@@ -117,12 +117,21 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="exportUvsTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
<metadata name="UVName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UVEnabled.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UVType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="keyToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>162, 17</value>
</metadata>
<metadata name="exportUvsTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>57</value>
</metadata>

View File

@@ -335,8 +335,8 @@ namespace AssetStudio.GUI
}
var m_Animator = (Animator)item.Asset;
var convert = animationList != null
? new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations);
? new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations);
ExportFbx(convert, exportFullPath);
return true;
}
@@ -356,8 +356,8 @@ namespace AssetStudio.GUI
public static void ExportGameObject(GameObject gameObject, string exportPath, List<AssetItem> animationList = null)
{
var convert = animationList != null
? new ModelConverter(gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations);
? new ModelConverter(gameObject, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(gameObject, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations);
exportPath = exportPath + FixFileName(gameObject.m_Name) + ".fbx";
ExportFbx(convert, exportPath);
}
@@ -366,8 +366,8 @@ namespace AssetStudio.GUI
{
var rootName = Path.GetFileNameWithoutExtension(exportPath);
var convert = animationList != null
? new ModelConverter(rootName, gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(rootName, gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations);
? new ModelConverter(rootName, gameObject, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(rootName, gameObject, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, Properties.Settings.Default.collectAnimations);
ExportFbx(convert, exportPath);
}
@@ -383,8 +383,6 @@ namespace AssetStudio.GUI
exportBlendShape = Properties.Settings.Default.exportBlendShape,
castToBone = Properties.Settings.Default.castToBone,
boneSize = (int)Properties.Settings.Default.boneSize,
exportAllUvsAsDiffuseMaps = Properties.Settings.Default.exportAllUvsAsDiffuseMaps,
exportUV0UV1 = Properties.Settings.Default.exportUV0UV1,
scaleFactor = (float)Properties.Settings.Default.scaleFactor,
fbxVersion = Properties.Settings.Default.fbxVersion,
fbxFormat = Properties.Settings.Default.fbxFormat

View File

@@ -111,9 +111,6 @@ namespace AssetStudio.GUI
MiHoYoBinData.Encrypted = Properties.Settings.Default.encrypted;
MiHoYoBinData.Key = Properties.Settings.Default.key;
AssetsHelper.Minimal = Properties.Settings.Default.minimalAssetMap;
Renderer.Parsable = !Properties.Settings.Default.disableRenderer;
Shader.Parsable = !Properties.Settings.Default.disableShader;
AnimationClip.Parsable = !Properties.Settings.Default.disableAnimationClip;
}
private void InitializeLogger()
@@ -1293,12 +1290,12 @@ namespace AssetStudio.GUI
private void PreviewGameObject(GameObject m_GameObject)
{
var model = new ModelConverter(m_GameObject, Properties.Settings.Default.convertType, Studio.Game, false, Array.Empty<AnimationClip>());
var model = new ModelConverter(m_GameObject, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, false, Array.Empty<AnimationClip>());
PreviewModel(model);
}
private void PreviewAnimator(Animator m_Animator)
{
var model = new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, false, Array.Empty<AnimationClip>());
var model = new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Properties.Settings.Default.texs, Properties.Settings.Default.uvs, Studio.Game, false, Array.Empty<AnimationClip>());
PreviewModel(model);
}

View File

@@ -12,7 +12,7 @@ namespace AssetStudio.GUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -263,18 +263,6 @@ namespace AssetStudio.GUI.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool exportAllUvsAsDiffuseMaps {
get {
return ((bool)(this["exportAllUvsAsDiffuseMaps"]));
}
set {
this["exportAllUvsAsDiffuseMaps"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("147")]
@@ -371,42 +359,6 @@ namespace AssetStudio.GUI.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool exportUV0UV1 {
get {
return ((bool)(this["exportUV0UV1"]));
}
set {
this["exportUV0UV1"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool disableShader {
get {
return ((bool)(this["disableShader"]));
}
set {
this["disableShader"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool disableRenderer {
get {
return ((bool)(this["disableRenderer"]));
}
set {
this["disableRenderer"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
@@ -467,18 +419,6 @@ namespace AssetStudio.GUI.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool disableAnimationClip {
get {
return ((bool)(this["disableAnimationClip"]));
}
set {
this["disableAnimationClip"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
@@ -502,5 +442,32 @@ namespace AssetStudio.GUI.Properties {
this["enableVerbose"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("{\"UV0\":{\"Item1\":true,\"Item2\":0},\"UV1\":{\"Item1\":false,\"Item2\":1},\"UV2\":{\"Item1\":tr" +
"ue,\"Item2\":0},\"UV3\":{\"Item1\":false,\"Item2\":0},\"UV4\":{\"Item1\":false,\"Item2\":0},\"U" +
"V5\":{\"Item1\":false,\"Item2\":0},\"UV6\":{\"Item1\":true,\"Item2\":0},\"UV7\":{\"Item1\":true" +
",\"Item2\":0}}")]
public string uvs {
get {
return ((string)(this["uvs"]));
}
set {
this["uvs"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("{}")]
public string texs {
get {
return ((string)(this["texs"]));
}
set {
this["texs"] = value;
}
}
}
}

View File

@@ -62,9 +62,6 @@
<Setting Name="restoreExtensionName" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="exportAllUvsAsDiffuseMaps" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="key" Type="System.Byte" Scope="User">
<Value Profile="(Default)">147</Value>
</Setting>
@@ -89,15 +86,6 @@
<Setting Name="skipContainer" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="exportUV0UV1" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="disableShader" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="disableRenderer" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="minimalAssetMap" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
@@ -113,14 +101,17 @@
<Setting Name="selectedCABMapName" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="disableAnimationClip" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="enableFileLogging" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="enableVerbose" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="uvs" Type="System.String" Scope="User">
<Value Profile="(Default)">{"UV0":{"Item1":true,"Item2":0},"UV1":{"Item1":false,"Item2":1},"UV2":{"Item1":true,"Item2":0},"UV3":{"Item1":false,"Item2":0},"UV4":{"Item1":false,"Item2":0},"UV5":{"Item1":false,"Item2":0},"UV6":{"Item1":true,"Item2":0},"UV7":{"Item1":true,"Item2":0}}</Value>
</Setting>
<Setting Name="texs" Type="System.String" Scope="User">
<Value Profile="(Default)">{}</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -301,13 +301,13 @@ namespace AssetStudio.GUI
break;
case Mesh _:
case TextAsset _:
case AnimationClip _ when AnimationClip.Parsable:
case AnimationClip _:
case Font _:
case MovieTexture _:
case Sprite _:
case Material _:
case MiHoYoBinData _:
case Shader _ when Shader.Parsable:
case Shader _:
case Animator _:
case MonoBehaviour _:
exportable = true;

View File

@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -23,11 +24,15 @@ namespace AssetStudio
private Dictionary<Texture2D, string> textureNameDictionary = new Dictionary<Texture2D, string>();
private Dictionary<Transform, ImportedFrame> transformDictionary = new Dictionary<Transform, ImportedFrame>();
Dictionary<uint, string> morphChannelNames = new Dictionary<uint, string>();
Dictionary<string, (bool, int)> uvs = new Dictionary<string, (bool, int)>();
Dictionary<string, int> texs = new Dictionary<string, int>();
public ModelConverter(GameObject m_GameObject, ImageFormat imageFormat, Game game, bool collectAnimations, AnimationClip[] animationList = null)
public ModelConverter(GameObject m_GameObject, ImageFormat imageFormat, string texs, string uvs, Game game, bool collectAnimations, AnimationClip[] animationList = null)
{
Game = game;
this.imageFormat = imageFormat;
this.texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(texs);
this.uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(uvs);
if (m_GameObject.m_Animator != null)
{
InitWithAnimator(m_GameObject.m_Animator);
@@ -50,10 +55,12 @@ namespace AssetStudio
ConvertAnimations();
}
public ModelConverter(string rootName, List<GameObject> m_GameObjects, ImageFormat imageFormat, Game game, bool collectAnimations, AnimationClip[] animationList = null)
public ModelConverter(string rootName, List<GameObject> m_GameObjects, ImageFormat imageFormat, string texs, string uvs, Game game, bool collectAnimations, AnimationClip[] animationList = null)
{
Game = game;
this.imageFormat = imageFormat;
this.texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(texs);
this.uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(uvs);
RootFrame = CreateFrame(rootName, Vector3.Zero, new Quaternion(0, 0, 0, 0), Vector3.One);
foreach (var m_GameObject in m_GameObjects)
{
@@ -81,10 +88,12 @@ namespace AssetStudio
ConvertAnimations();
}
public ModelConverter(Animator m_Animator, ImageFormat imageFormat, Game game, bool collectAnimations, AnimationClip[] animationList = null)
public ModelConverter(Animator m_Animator, ImageFormat imageFormat, string texs, string uvs, Game game, bool collectAnimations, AnimationClip[] animationList = null)
{
Game = game;
this.imageFormat = imageFormat;
this.texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(texs);
this.uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(uvs);
InitWithAnimator(m_Animator);
if (animationList == null && collectAnimations)
{
@@ -300,9 +309,12 @@ namespace AssetStudio
iMesh.hasNormal = mesh.m_Normals?.Length > 0;
iMesh.hasUV = new bool[8];
iMesh.uvType = new int[8];
for (int uv = 0; uv < 8; uv++)
{
iMesh.hasUV[uv] = mesh.GetUV(uv)?.Length > 0;
var key = $"UV{uv}";
iMesh.hasUV[uv] = mesh.GetUV(uv)?.Length > 0 && uvs[key].Item1;
iMesh.uvType[uv] = uvs[key].Item2;
}
iMesh.hasTangent = mesh.m_Tangents != null && mesh.m_Tangents.Length == mesh.m_VertexCount * 4;
iMesh.hasColor = mesh.m_Colors?.Length > 0;
@@ -708,7 +720,9 @@ namespace AssetStudio
iMat.Textures.Add(texture);
int dest = -1;
if (texEnv.Key == "_MainTex")
if (texs.TryGetValue(texEnv.Key, out var targetDest))
dest = targetDest;
else if (texEnv.Key == "_MainTex")
dest = 0;
else if (texEnv.Key == "_BumpMap")
dest = 3;
@@ -716,10 +730,6 @@ namespace AssetStudio
dest = 2;
else if (texEnv.Key.Contains("Normal"))
dest = 1;
else if (Game.Type.IsSRGroup() && texEnv.Key.Contains("Pack"))
dest = 0;
else if (Game.Type.IsArknightsEndfield() && texEnv.Key == "_BaseMap")
dest = 0;
texture.Dest = dest;

View File

@@ -388,7 +388,7 @@ namespace AssetStudio
asset.Name = gameObject.m_Name;
exportable = !Minimal;
break;
case ClassIDType.Shader when Shader.Parsable:
case ClassIDType.Shader:
asset.Name = objectReader.ReadAlignedString();
if (string.IsNullOrEmpty(asset.Name))
{
@@ -423,7 +423,7 @@ namespace AssetStudio
case ClassIDType.Texture2D:
case ClassIDType.VideoClip:
case ClassIDType.AudioClip:
case ClassIDType.AnimationClip when AnimationClip.Parsable:
case ClassIDType.AnimationClip:
asset.Name = objectReader.ReadAlignedString();
break;
default:

View File

@@ -646,7 +646,7 @@ namespace AssetStudio
Object obj = objectReader.type switch
{
ClassIDType.Animation => new Animation(objectReader),
ClassIDType.AnimationClip when AnimationClip.Parsable => new AnimationClip(objectReader),
ClassIDType.AnimationClip => new AnimationClip(objectReader),
ClassIDType.Animator => new Animator(objectReader),
ClassIDType.AnimatorController => new AnimatorController(objectReader),
ClassIDType.AnimatorOverrideController => new AnimatorOverrideController(objectReader),
@@ -659,15 +659,15 @@ namespace AssetStudio
ClassIDType.Material => new Material(objectReader),
ClassIDType.Mesh => new Mesh(objectReader),
ClassIDType.MeshFilter => new MeshFilter(objectReader),
ClassIDType.MeshRenderer when Renderer.Parsable => new MeshRenderer(objectReader),
ClassIDType.MeshRenderer => new MeshRenderer(objectReader),
ClassIDType.MiHoYoBinData => new MiHoYoBinData(objectReader),
ClassIDType.MonoBehaviour => new MonoBehaviour(objectReader),
ClassIDType.MonoScript => new MonoScript(objectReader),
ClassIDType.MovieTexture => new MovieTexture(objectReader),
ClassIDType.PlayerSettings => new PlayerSettings(objectReader),
ClassIDType.RectTransform => new RectTransform(objectReader),
ClassIDType.Shader when Shader.Parsable => new Shader(objectReader),
ClassIDType.SkinnedMeshRenderer when Renderer.Parsable => new SkinnedMeshRenderer(objectReader),
ClassIDType.Shader => new Shader(objectReader),
ClassIDType.SkinnedMeshRenderer => new SkinnedMeshRenderer(objectReader),
ClassIDType.Sprite => new Sprite(objectReader),
ClassIDType.SpriteAtlas => new SpriteAtlas(objectReader),
ClassIDType.TextAsset => new TextAsset(objectReader),

View File

@@ -1717,8 +1717,6 @@ namespace AssetStudio
public sealed class AnimationClip : NamedObject
{
public static bool Parsable;
public AnimationType m_AnimationType;
public bool m_Legacy;
public bool m_Compressed;

View File

@@ -19,8 +19,6 @@ namespace AssetStudio
public abstract class Renderer : Component
{
public static bool Parsable;
public List<PPtr<Material>> m_Materials;
public StaticBatchInfo m_StaticBatchInfo;
public uint[] m_SubsetIndices;

View File

@@ -988,8 +988,6 @@ namespace AssetStudio
public class Shader : NamedObject
{
public static bool Parsable;
public byte[] m_Script;
//5.3 - 5.4
public uint decompressedSize;

View File

@@ -159,6 +159,7 @@ namespace AssetStudio
public List<ImportedBone> BoneList { get; set; }
public bool hasNormal { get; set; }
public bool[] hasUV { get; set; }
public int[] uvType { get; set; }
public bool hasTangent { get; set; }
public bool hasColor { get; set; }
}