diff --git a/AssetStudioGUI/App.config b/AssetStudioGUI/App.config index bf3422a..1f170a6 100644 --- a/AssetStudioGUI/App.config +++ b/AssetStudioGUI/App.config @@ -106,6 +106,9 @@ False + + False + \ No newline at end of file diff --git a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs index 78aaa8c..df25025 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs @@ -45,7 +45,7 @@ namespace AssetStudioGUI optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); displayAll = new System.Windows.Forms.ToolStripMenuItem(); enablePreview = new System.Windows.Forms.ToolStripMenuItem(); - enableModelPreview = new System.Windows.Forms.ToolStripMenuItem(); + modelsOnly = new System.Windows.Forms.ToolStripMenuItem(); displayInfo = new System.Windows.Forms.ToolStripMenuItem(); toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem(); specifyUnityVersion = new System.Windows.Forms.ToolStripTextBox(); @@ -161,6 +161,7 @@ namespace AssetStudioGUI exportAnimatorwithselectedAnimationClipMenuItem = new System.Windows.Forms.ToolStripMenuItem(); goToSceneHierarchyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); showOriginalFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + enableModelPreview = new System.Windows.Forms.ToolStripMenuItem(); menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit(); splitContainer1.Panel1.SuspendLayout(); @@ -252,7 +253,7 @@ namespace AssetStudioGUI // // optionsToolStripMenuItem // - optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { displayAll, enablePreview, enableModelPreview, displayInfo, toolStripMenuItem14, toolStripMenuItem18, toolStripMenuItem19, showExpOpt }); + optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { displayAll, enablePreview, enableModelPreview, modelsOnly, displayInfo, toolStripMenuItem14, toolStripMenuItem18, toolStripMenuItem19, showExpOpt }); optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); optionsToolStripMenuItem.Text = "Options"; @@ -277,13 +278,13 @@ namespace AssetStudioGUI enablePreview.ToolTipText = "Toggle the loading and preview of readable assets, such as images, sounds, text, etc.\r\nDisable preview if you have performance or compatibility issues."; enablePreview.CheckedChanged += enablePreview_Check; // - // enableModelPreview + // modelsOnly // - enableModelPreview.CheckOnClick = true; - enableModelPreview.Name = "enableModelPreview"; - enableModelPreview.Size = new System.Drawing.Size(207, 22); - enableModelPreview.Text = "Enable model preview"; - enableModelPreview.CheckedChanged += enableModelPreview_CheckedChanged; + modelsOnly.CheckOnClick = true; + modelsOnly.Name = "modelsOnly"; + modelsOnly.Size = new System.Drawing.Size(207, 22); + modelsOnly.Text = "Filter models only"; + modelsOnly.CheckedChanged += modelsOnly_CheckedChanged; // // displayInfo // @@ -1257,6 +1258,14 @@ namespace AssetStudioGUI showOriginalFileToolStripMenuItem.Visible = false; showOriginalFileToolStripMenuItem.Click += showOriginalFileToolStripMenuItem_Click; // + // enableModelPreview + // + enableModelPreview.CheckOnClick = true; + enableModelPreview.Name = "enableModelPreview"; + enableModelPreview.Size = new System.Drawing.Size(207, 22); + enableModelPreview.Text = "Enable model preview"; + enableModelPreview.CheckedChanged += enableModelPreview_CheckedChanged; + // // AssetStudioGUIForm // AllowDrop = true; @@ -1434,6 +1443,7 @@ namespace AssetStudioGUI private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; private System.Windows.Forms.ToolStripMenuItem exportSelectedNodessplitToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exportSelectedNodessplitSelectedAnimationClipsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem modelsOnly; private System.Windows.Forms.ToolStripMenuItem enableModelPreview; } } diff --git a/AssetStudioGUI/AssetStudioGUIForm.cs b/AssetStudioGUI/AssetStudioGUIForm.cs index bed4472..bebd38f 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.cs @@ -108,7 +108,8 @@ namespace AssetStudioGUI displayAll.Checked = Properties.Settings.Default.displayAll; displayInfo.Checked = Properties.Settings.Default.displayInfo; enablePreview.Checked = Properties.Settings.Default.enablePreview; - enableModelPreview.Checked = Properties.Settings.Default.modelsOnly; + enableModelPreview.Checked = Properties.Settings.Default.enableModelPreview; + modelsOnly.Checked = Properties.Settings.Default.modelsOnly; assetsManager.ResolveDependencies = Properties.Settings.Default.enableResolveDependencies; MiHoYoBinData.Encrypted = Properties.Settings.Default.encrypted; MiHoYoBinData.Key = Properties.Settings.Default.key; @@ -760,7 +761,7 @@ namespace AssetStudioGUI { switch (assetItem.Asset) { - case GameObject m_GameObject when Properties.Settings.Default.modelsOnly: + case GameObject m_GameObject when Properties.Settings.Default.enableModelPreview: PreviewGameObject(m_GameObject); break; case Texture2D m_Texture2D: @@ -791,7 +792,7 @@ namespace AssetStudioGUI case Sprite m_Sprite: PreviewSprite(assetItem, m_Sprite); break; - case Animator m_Animator when Properties.Settings.Default.modelsOnly: + case Animator m_Animator when Properties.Settings.Default.enableModelPreview: //StatusStripUpdate("Can be exported to FBX file."); PreviewAnimator(m_Animator); break; @@ -1966,9 +1967,9 @@ namespace AssetStudioGUI Properties.Settings.Default.selectedAssetMapType = assetMapTypeComboBox.SelectedIndex; Properties.Settings.Default.Save(); } - private void enableModelPreview_CheckedChanged(object sender, EventArgs e) + private void modelsOnly_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.modelsOnly = enableModelPreview.Checked; + Properties.Settings.Default.modelsOnly = modelsOnly.Checked; Properties.Settings.Default.Save(); if (visibleAssets.Count > 0) @@ -1976,6 +1977,11 @@ namespace AssetStudioGUI FilterAssetList(); } } + private void enableModelPreview_CheckedChanged(object sender, EventArgs e) + { + Properties.Settings.Default.enableModelPreview = enableModelPreview.Checked; + Properties.Settings.Default.Save(); + } private void specifyGame_SelectedIndexChanged(object sender, EventArgs e) { diff --git a/AssetStudioGUI/AssetStudioGUIForm.resx b/AssetStudioGUI/AssetStudioGUIForm.resx index 3d8c540..ee3dd05 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.resx +++ b/AssetStudioGUI/AssetStudioGUIForm.resx @@ -60,6 +60,9 @@ 312, 17 + + 432, 17 + abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWYZ 1234567890.:,;'\"(!?)+-*/= @@ -78,9 +81,6 @@ The quick brown fox jumps over the lazy dog. 1234567890 The quick brown fox jumps over the lazy dog. 1234567890 - - 432, 17 - 553, 17 diff --git a/AssetStudioGUI/Exporter.cs b/AssetStudioGUI/Exporter.cs index 71e9542..31eeead 100644 --- a/AssetStudioGUI/Exporter.cs +++ b/AssetStudioGUI/Exporter.cs @@ -331,6 +331,18 @@ namespace AssetStudioGUI return true; } + public static bool ExportGameObject(AssetItem item, string exportPath, List animationList = null) + { + var exportFullPath = Path.Combine(exportPath, item.Text, item.Text + ".fbx"); + if (File.Exists(exportFullPath)) + { + exportFullPath = Path.Combine(exportPath, item.Text + item.UniqueID, item.Text + ".fbx"); + } + var m_GameObject = (GameObject)item.Asset; + ExportGameObject(m_GameObject, exportFullPath, animationList); + return true; + } + public static void ExportGameObject(GameObject gameObject, string exportPath, List animationList = null) { var convert = animationList != null @@ -390,6 +402,8 @@ namespace AssetStudioGUI { switch (item.Type) { + case ClassIDType.GameObject: + return ExportGameObject(item, exportPath); case ClassIDType.Texture2D: return ExportTexture2D(item, exportPath); case ClassIDType.AudioClip: diff --git a/AssetStudioGUI/Properties/Settings.Designer.cs b/AssetStudioGUI/Properties/Settings.Designer.cs index 7ea06e8..94084cb 100644 --- a/AssetStudioGUI/Properties/Settings.Designer.cs +++ b/AssetStudioGUI/Properties/Settings.Designer.cs @@ -430,5 +430,17 @@ namespace AssetStudioGUI.Properties { this["modelsOnly"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool enableModelPreview { + get { + return ((bool)(this["enableModelPreview"])); + } + set { + this["enableModelPreview"] = value; + } + } } } diff --git a/AssetStudioGUI/Properties/Settings.settings b/AssetStudioGUI/Properties/Settings.settings index 154a3b2..a26d555 100644 --- a/AssetStudioGUI/Properties/Settings.settings +++ b/AssetStudioGUI/Properties/Settings.settings @@ -104,5 +104,8 @@ False + + False + \ No newline at end of file