- [Core] Added export option to include materials with models in /Materials.
- [GUI] fix issue with `Reset` button causing unintended behaviour. - [Core] fix bug where `Logger` causes performance issues.
This commit is contained in:
@@ -1,126 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="AssetStudio.GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<userSettings>
|
||||
<AssetStudio.GUI.Properties.Settings>
|
||||
<setting name="displayAll" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="enablePreview" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="displayInfo" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="openAfterExport" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="assetGroupOption" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="convertTexture" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="convertAudio" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="eulerFilter" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="filterPrecision" serializeAs="String">
|
||||
<value>0.25</value>
|
||||
</setting>
|
||||
<setting name="exportAllNodes" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="exportSkins" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="exportAnimations" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="boneSize" serializeAs="String">
|
||||
<value>10</value>
|
||||
</setting>
|
||||
<setting name="fbxVersion" serializeAs="String">
|
||||
<value>3</value>
|
||||
</setting>
|
||||
<setting name="fbxFormat" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="scaleFactor" serializeAs="String">
|
||||
<value>1</value>
|
||||
</setting>
|
||||
<setting name="exportBlendShape" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="castToBone" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="restoreExtensionName" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="key" serializeAs="String">
|
||||
<value>147</value>
|
||||
</setting>
|
||||
<setting name="enableConsole" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="encrypted" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="selectedGame" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="enableResolveDependencies" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="assetMapType" serializeAs="String">
|
||||
<value>1</value>
|
||||
</setting>
|
||||
<setting name="collectAnimations" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="skipContainer" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="minimalAssetMap" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="modelsOnly" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="enableModelPreview" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="selectedUnityCNKey" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="selectedCABMapName" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="enableFileLogging" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="uvs" serializeAs="String">
|
||||
<value>{"UV0":{"Item1":true,"Item2":0},"UV1":{"Item1":true,"Item2":1},"UV2":{"Item1":false,"Item2":0},"UV3":{"Item1":false,"Item2":0},"UV4":{"Item1":false,"Item2":0},"UV5":{"Item1":false,"Item2":0},"UV6":{"Item1":false,"Item2":0},"UV7":{"Item1":false,"Item2":0}}</value>
|
||||
</setting>
|
||||
<setting name="allowDuplicates" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="loggerEventType" serializeAs="String">
|
||||
<value>30</value>
|
||||
</setting>
|
||||
<setting name="types" serializeAs="String">
|
||||
<value>{"Animation":{"Item1":true,"Item2":false},"AnimationClip":{"Item1":true,"Item2":true},"Animator":{"Item1":true,"Item2":true},"AnimatorController":{"Item1":true,"Item2":false},"AnimatorOverrideController":{"Item1":true,"Item2":false},"AssetBundle":{"Item1":true,"Item2":false},"AudioClip":{"Item1":true,"Item2":true},"Avatar":{"Item1":true,"Item2":false},"Font":{"Item1":true,"Item2":true},"GameObject":{"Item1":true,"Item2":false},"IndexObject":{"Item1":true,"Item2":false},"Material":{"Item1":true,"Item2":true},"Mesh":{"Item1":true,"Item2":true},"MeshFilter":{"Item1":true,"Item2":false},"MeshRenderer":{"Item1":true,"Item2":false},"MiHoYoBinData":{"Item1":true,"Item2":true},"MonoBehaviour":{"Item1":true,"Item2":true},"MonoScript":{"Item1":true,"Item2":false},"MovieTexture":{"Item1":true,"Item2":true},"PlayerSettings":{"Item1":true,"Item2":false},"RectTransform":{"Item1":true,"Item2":false},"Shader":{"Item1":true,"Item2":true},"SkinnedMeshRenderer":{"Item1":true,"Item2":false},"Sprite":{"Item1":true,"Item2":true},"SpriteAtlas":{"Item1":true,"Item2":false},"TextAsset":{"Item1":true,"Item2":true},"Texture2D":{"Item1":true,"Item2":true},"Transform":{"Item1":true,"Item2":false},"VideoClip":{"Item1":true,"Item2":true},"ResourceManager":{"Item1":true,"Item2":false}}</value>
|
||||
</setting>
|
||||
<setting name="texs" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</AssetStudio.GUI.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
14
AssetStudio.GUI/ExportOptions.Designer.cs
generated
14
AssetStudio.GUI/ExportOptions.Designer.cs
generated
@@ -66,6 +66,7 @@ namespace AssetStudio.GUI
|
||||
converttexture = new CheckBox();
|
||||
collectAnimations = new CheckBox();
|
||||
groupBox2 = new GroupBox();
|
||||
exportMaterials = new CheckBox();
|
||||
exportBlendShape = new CheckBox();
|
||||
exportAnimations = new CheckBox();
|
||||
scaleFactor = new NumericUpDown();
|
||||
@@ -471,6 +472,7 @@ namespace AssetStudio.GUI
|
||||
// groupBox2
|
||||
//
|
||||
groupBox2.AutoSize = true;
|
||||
groupBox2.Controls.Add(exportMaterials);
|
||||
groupBox2.Controls.Add(collectAnimations);
|
||||
groupBox2.Controls.Add(exportBlendShape);
|
||||
groupBox2.Controls.Add(exportAnimations);
|
||||
@@ -497,6 +499,17 @@ namespace AssetStudio.GUI
|
||||
groupBox2.TabStop = false;
|
||||
groupBox2.Text = "Fbx";
|
||||
//
|
||||
// exportMaterials
|
||||
//
|
||||
exportMaterials.AutoSize = true;
|
||||
exportMaterials.Location = new System.Drawing.Point(154, 96);
|
||||
exportMaterials.Margin = new Padding(4);
|
||||
exportMaterials.Name = "exportMaterials";
|
||||
exportMaterials.Size = new System.Drawing.Size(111, 19);
|
||||
exportMaterials.TabIndex = 25;
|
||||
exportMaterials.Text = "Export materials";
|
||||
exportMaterials.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// exportBlendShape
|
||||
//
|
||||
exportBlendShape.AutoSize = true;
|
||||
@@ -780,5 +793,6 @@ namespace AssetStudio.GUI
|
||||
private ComboBox texNameComboBox;
|
||||
private Button addTexNameButton;
|
||||
private Button removeTexNameButton;
|
||||
private CheckBox exportMaterials;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@@ -34,6 +36,7 @@ namespace AssetStudio.GUI
|
||||
filterPrecision.Value = Properties.Settings.Default.filterPrecision;
|
||||
exportAllNodes.Checked = Properties.Settings.Default.exportAllNodes;
|
||||
exportSkins.Checked = Properties.Settings.Default.exportSkins;
|
||||
exportMaterials.Checked = Properties.Settings.Default.exportMaterials;
|
||||
exportAnimations.Checked = Properties.Settings.Default.exportAnimations;
|
||||
exportBlendShape.Checked = Properties.Settings.Default.exportBlendShape;
|
||||
castToBone.Checked = Properties.Settings.Default.castToBone;
|
||||
@@ -84,6 +87,7 @@ namespace AssetStudio.GUI
|
||||
Properties.Settings.Default.filterPrecision = filterPrecision.Value;
|
||||
Properties.Settings.Default.exportAllNodes = exportAllNodes.Checked;
|
||||
Properties.Settings.Default.exportSkins = exportSkins.Checked;
|
||||
Properties.Settings.Default.exportMaterials = exportMaterials.Checked;
|
||||
Properties.Settings.Default.exportAnimations = exportAnimations.Checked;
|
||||
Properties.Settings.Default.exportBlendShape = exportBlendShape.Checked;
|
||||
Properties.Settings.Default.castToBone = castToBone.Checked;
|
||||
@@ -251,7 +255,12 @@ namespace AssetStudio.GUI
|
||||
|
||||
private void Reset_Click(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.Reset();
|
||||
foreach(SettingsProperty settingsProperty in Properties.Settings.Default.Properties)
|
||||
{
|
||||
Properties.Settings.Default[settingsProperty.Name] = TypeDescriptor.GetConverter(settingsProperty.PropertyType).ConvertFrom(settingsProperty.DefaultValue);
|
||||
}
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Resetted = true;
|
||||
Close();
|
||||
|
||||
@@ -364,12 +364,24 @@ namespace AssetStudio.GUI
|
||||
imageFormat = Properties.Settings.Default.convertType,
|
||||
game = Studio.Game,
|
||||
collectAnimations = Properties.Settings.Default.collectAnimations,
|
||||
exportMaterials = Properties.Settings.Default.exportMaterials,
|
||||
materials = new HashSet<Material>(),
|
||||
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
|
||||
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
|
||||
};
|
||||
var convert = animationList != null
|
||||
? new ModelConverter(m_Animator, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
|
||||
: new ModelConverter(m_Animator, options);
|
||||
if (options.exportMaterials)
|
||||
{
|
||||
var materialExportPath = Path.Combine(exportFullPath, "Materials");
|
||||
Directory.CreateDirectory(materialExportPath);
|
||||
foreach (var material in options.materials)
|
||||
{
|
||||
var matItem = new AssetItem(material);
|
||||
ExportJSONFile(matItem, materialExportPath);
|
||||
}
|
||||
}
|
||||
ExportFbx(convert, exportFullPath);
|
||||
return true;
|
||||
}
|
||||
@@ -390,8 +402,10 @@ namespace AssetStudio.GUI
|
||||
imageFormat = Properties.Settings.Default.convertType,
|
||||
game = Studio.Game,
|
||||
collectAnimations = Properties.Settings.Default.collectAnimations,
|
||||
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
|
||||
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
|
||||
exportMaterials = Properties.Settings.Default.exportMaterials,
|
||||
materials = new HashSet<Material>(),
|
||||
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs, new JsonSerializerSettings() { DefaultValueHandling = DefaultValueHandling.Populate }),
|
||||
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs, new JsonSerializerSettings() { DefaultValueHandling = DefaultValueHandling.Populate }),
|
||||
};
|
||||
var convert = animationList != null
|
||||
? new ModelConverter(gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
|
||||
@@ -402,6 +416,16 @@ namespace AssetStudio.GUI
|
||||
Logger.Info($"GameObject {gameObject.m_Name} has no mesh, skipping...");
|
||||
return false;
|
||||
}
|
||||
if (options.exportMaterials)
|
||||
{
|
||||
var materialExportPath = Path.Combine(exportPath, "Materials");
|
||||
Directory.CreateDirectory(materialExportPath);
|
||||
foreach (var material in options.materials)
|
||||
{
|
||||
var matItem = new AssetItem(material);
|
||||
ExportJSONFile(matItem, materialExportPath);
|
||||
}
|
||||
}
|
||||
exportPath = exportPath + FixFileName(gameObject.m_Name) + ".fbx";
|
||||
ExportFbx(convert, exportPath);
|
||||
return true;
|
||||
@@ -415,12 +439,24 @@ namespace AssetStudio.GUI
|
||||
imageFormat = Properties.Settings.Default.convertType,
|
||||
game = Studio.Game,
|
||||
collectAnimations = Properties.Settings.Default.collectAnimations,
|
||||
exportMaterials = Properties.Settings.Default.exportMaterials,
|
||||
materials = new HashSet<Material>(),
|
||||
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
|
||||
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
|
||||
};
|
||||
var convert = animationList != null
|
||||
? new ModelConverter(rootName, gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
|
||||
: new ModelConverter(rootName, gameObject, options);
|
||||
if (options.exportMaterials)
|
||||
{
|
||||
var materialExportPath = Path.Combine(exportPath, "Materials");
|
||||
Directory.CreateDirectory(materialExportPath);
|
||||
foreach (var material in options.materials)
|
||||
{
|
||||
var matItem = new AssetItem(material);
|
||||
ExportJSONFile(matItem, materialExportPath);
|
||||
}
|
||||
}
|
||||
ExportFbx(convert, exportPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace AssetStudio.GUI
|
||||
var menuItem = new ToolStripMenuItem(loggerEvent.ToString()) { CheckOnClick = true, Checked = loggerEventType.HasFlag(loggerEvent), Tag = (int)loggerEvent };
|
||||
loggedEventsMenuItem.DropDownItems.Add(menuItem);
|
||||
}
|
||||
Logger.Default.Flags = loggerEventType;
|
||||
Logger.Flags = loggerEventType;
|
||||
Logger.FileLogging = enableFileLogging.Checked;
|
||||
}
|
||||
|
||||
@@ -1312,6 +1312,8 @@ namespace AssetStudio.GUI
|
||||
imageFormat = Properties.Settings.Default.convertType,
|
||||
game = Studio.Game,
|
||||
collectAnimations = Properties.Settings.Default.collectAnimations,
|
||||
exportMaterials = false,
|
||||
materials = new HashSet<Material>(),
|
||||
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
|
||||
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
|
||||
};
|
||||
@@ -1325,6 +1327,8 @@ namespace AssetStudio.GUI
|
||||
imageFormat = Properties.Settings.Default.convertType,
|
||||
game = Studio.Game,
|
||||
collectAnimations = Properties.Settings.Default.collectAnimations,
|
||||
exportMaterials = false,
|
||||
materials = new HashSet<Material>(),
|
||||
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
|
||||
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
|
||||
};
|
||||
@@ -2354,7 +2358,7 @@ namespace AssetStudio.GUI
|
||||
Properties.Settings.Default.loggerEventType = loggedEventsMenuItem.DropDownItems.Cast<ToolStripMenuItem>().Select(x => x.Checked ? (int)x.Tag : 0).Sum();
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
Logger.Default.Flags = (LoggerEvent)Properties.Settings.Default.loggerEventType;
|
||||
Logger.Flags = (LoggerEvent)Properties.Settings.Default.loggerEventType;
|
||||
}
|
||||
|
||||
private void abortStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
||||
14
AssetStudio.GUI/Properties/Settings.Designer.cs
generated
14
AssetStudio.GUI/Properties/Settings.Designer.cs
generated
@@ -484,7 +484,7 @@ namespace AssetStudio.GUI.Properties {
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("{}")]
|
||||
public string texs {
|
||||
get {
|
||||
return ((string)(this["texs"]));
|
||||
@@ -493,5 +493,17 @@ namespace AssetStudio.GUI.Properties {
|
||||
this["texs"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool exportMaterials {
|
||||
get {
|
||||
return ((bool)(this["exportMaterials"]));
|
||||
}
|
||||
set {
|
||||
this["exportMaterials"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,10 @@
|
||||
<Value Profile="(Default)">{"Animation":{"Item1":true,"Item2":false},"AnimationClip":{"Item1":true,"Item2":true},"Animator":{"Item1":true,"Item2":true},"AnimatorController":{"Item1":true,"Item2":false},"AnimatorOverrideController":{"Item1":true,"Item2":false},"AssetBundle":{"Item1":true,"Item2":false},"AudioClip":{"Item1":true,"Item2":true},"Avatar":{"Item1":true,"Item2":false},"Font":{"Item1":true,"Item2":true},"GameObject":{"Item1":true,"Item2":false},"IndexObject":{"Item1":true,"Item2":false},"Material":{"Item1":true,"Item2":true},"Mesh":{"Item1":true,"Item2":true},"MeshFilter":{"Item1":true,"Item2":false},"MeshRenderer":{"Item1":true,"Item2":false},"MiHoYoBinData":{"Item1":true,"Item2":true},"MonoBehaviour":{"Item1":true,"Item2":true},"MonoScript":{"Item1":true,"Item2":false},"MovieTexture":{"Item1":true,"Item2":true},"PlayerSettings":{"Item1":true,"Item2":false},"RectTransform":{"Item1":true,"Item2":false},"Shader":{"Item1":true,"Item2":true},"SkinnedMeshRenderer":{"Item1":true,"Item2":false},"Sprite":{"Item1":true,"Item2":true},"SpriteAtlas":{"Item1":true,"Item2":false},"TextAsset":{"Item1":true,"Item2":true},"Texture2D":{"Item1":true,"Item2":true},"Transform":{"Item1":true,"Item2":false},"VideoClip":{"Item1":true,"Item2":true},"ResourceManager":{"Item1":true,"Item2":false}}</Value>
|
||||
</Setting>
|
||||
<Setting Name="texs" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
<Value Profile="(Default)">{}</Value>
|
||||
</Setting>
|
||||
<Setting Name="exportMaterials" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
Reference in New Issue
Block a user