This commit is contained in:
Razmoth
2024-01-27 20:42:18 +04:00
parent 873597730c
commit e19d7b91fe
26 changed files with 484 additions and 348 deletions

View File

@@ -22,23 +22,17 @@ jobs:
- name: Nuget Restore - name: Nuget Restore
run: nuget restore run: nuget restore
- name: Build .Net6
run: msbuild /t:AssetStudio_GUI:publish /p:Configuration=Release /p:TargetFramework=net6.0-windows /p:SelfContained=false /verbosity:minimal
- name: Build .Net7 - name: Build .Net7
run: msbuild /t:AssetStudio_GUI:publish /p:Configuration=Release /p:TargetFramework=net7.0-windows /p:SelfContained=false /verbosity:minimal run: msbuild /t:AssetStudio_GUI:publish /p:Configuration=Release /p:TargetFramework=net7.0-windows /p:SelfContained=false /verbosity:minimal
- name: Build .Net6 CLI - name: Build .Net8
run: msbuild /t:AssetStudio_CLI:publish /p:Configuration=Release /p:TargetFramework=net6.0-windows /p:SelfContained=false /verbosity:minimal run: msbuild /t:AssetStudio_GUI:publish /p:Configuration=Release /p:TargetFramework=net8.0-windows /p:SelfContained=false /verbosity:minimal
- name: Build .Net7 CLI - name: Build .Net7 CLI
run: msbuild /t:AssetStudio_CLI:publish /p:Configuration=Release /p:TargetFramework=net7.0-windows /p:SelfContained=false /verbosity:minimal run: msbuild /t:AssetStudio_CLI:publish /p:Configuration=Release /p:TargetFramework=net7.0-windows /p:SelfContained=false /verbosity:minimal
- name: Upload .Net6 Artifact - name: Build .Net8 CLI
uses: actions/upload-artifact@v3 run: msbuild /t:AssetStudio_CLI:publish /p:Configuration=Release /p:TargetFramework=net8.0-windows /p:SelfContained=false /verbosity:minimal
with:
name: net6.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net6.0-windows/publish
- name: Upload .Net7 Artifact - name: Upload .Net7 Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@@ -46,14 +40,20 @@ jobs:
name: net7.0-${{ github.sha }} name: net7.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net7.0-windows/publish path: AssetStudio.GUI/bin/Release/net7.0-windows/publish
- name: Upload .Net6 CLI Artifact - name: Upload .Net8 Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: net6.0-${{ github.sha }} name: net8.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net6.0-windows/publish path: AssetStudio.GUI/bin/Release/net8.0-windows/publish
- name: Upload .Net7 CLI Artifact - name: Upload .Net7 CLI Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: net7.0-${{ github.sha }} name: net7.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net7.0-windows/publish path: AssetStudio.GUI/bin/Release/net7.0-windows/publish
- name: Upload .Net8 CLI Artifact
uses: actions/upload-artifact@v3
with:
name: net8.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net8.0-windows/publish

View File

@@ -22,6 +22,7 @@
<add key="minimalAssetMap" value="True" /> <add key="minimalAssetMap" value="True" />
<add key="allowDuplicates" value="False" /> <add key="allowDuplicates" value="False" />
<add key="uvs" 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}}' /> <add key="uvs" 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}}' />
<add key="texs" value="{}" /> <add key="texs" value='{"0": "", "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": ""}' />
<add key="types" 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}}' />
</appSettings> </appSettings>
</configuration> </configuration>

View File

@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFrameworks>net6.0-windows;net7.0-windows</TargetFrameworks> <TargetFrameworks>net7.0-windows;net8.0-windows</TargetFrameworks>
<ApplicationIcon>Resources\as.ico</ApplicationIcon> <ApplicationIcon>Resources\as.ico</ApplicationIcon>
<Version>1.00.00</Version> <Version>1.36.00</Version>
<AssemblyVersion>1.00.00</AssemblyVersion> <AssemblyVersion>1.36.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion> <FileVersion>1.36.00</FileVersion>
<Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright> <Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright>
<BaseOutputPath>..\AssetStudio.GUI\bin</BaseOutputPath> <BaseOutputPath>..\AssetStudio.GUI\bin</BaseOutputPath>
</PropertyGroup> </PropertyGroup>

View File

@@ -33,7 +33,6 @@ namespace AssetStudio.CLI
optionsBinder.UnityVersion, optionsBinder.UnityVersion,
optionsBinder.GroupAssetsType, optionsBinder.GroupAssetsType,
optionsBinder.AssetExportType, optionsBinder.AssetExportType,
optionsBinder.Model,
optionsBinder.Key, optionsBinder.Key,
optionsBinder.AIFile, optionsBinder.AIFile,
optionsBinder.DummyDllFolder, optionsBinder.DummyDllFolder,
@@ -61,7 +60,6 @@ namespace AssetStudio.CLI
public string UnityVersion { get; set; } public string UnityVersion { get; set; }
public AssetGroupOption GroupAssetsType { get; set; } public AssetGroupOption GroupAssetsType { get; set; }
public ExportType AssetExportType { get; set; } public ExportType AssetExportType { get; set; }
public bool Model { get; set; }
public byte Key { get; set; } public byte Key { get; set; }
public FileInfo AIFile { get; set; } public FileInfo AIFile { get; set; }
public DirectoryInfo DummyDllFolder { get; set; } public DirectoryInfo DummyDllFolder { get; set; }
@@ -84,7 +82,6 @@ namespace AssetStudio.CLI
public readonly Option<string> UnityVersion; public readonly Option<string> UnityVersion;
public readonly Option<AssetGroupOption> GroupAssetsType; public readonly Option<AssetGroupOption> GroupAssetsType;
public readonly Option<ExportType> AssetExportType; public readonly Option<ExportType> AssetExportType;
public readonly Option<bool> Model;
public readonly Option<byte> Key; public readonly Option<byte> Key;
public readonly Option<FileInfo> AIFile; public readonly Option<FileInfo> AIFile;
public readonly Option<DirectoryInfo> DummyDllFolder; public readonly Option<DirectoryInfo> DummyDllFolder;
@@ -106,7 +103,6 @@ namespace AssetStudio.CLI
UnityVersion = new Option<string>("--unity_version", "Specify Unity version."); UnityVersion = new Option<string>("--unity_version", "Specify Unity version.");
GroupAssetsType = new Option<AssetGroupOption>("--group_assets", "Specify how exported assets should be grouped."); GroupAssetsType = new Option<AssetGroupOption>("--group_assets", "Specify how exported assets should be grouped.");
AssetExportType = new Option<ExportType>("--export_type", "Specify how assets should be exported."); AssetExportType = new Option<ExportType>("--export_type", "Specify how assets should be exported.");
Model = new Option<bool>("--models", "Enable to export models only");
AIFile = new Option<FileInfo>("--ai_file", "Specify asset_index json file path (to recover GI containers).").LegalFilePathsOnly(); AIFile = new Option<FileInfo>("--ai_file", "Specify asset_index json file path (to recover GI containers).").LegalFilePathsOnly();
DummyDllFolder = new Option<DirectoryInfo>("--dummy_dlls", "Specify DummyDll path.").LegalFilePathsOnly(); DummyDllFolder = new Option<DirectoryInfo>("--dummy_dlls", "Specify DummyDll path.").LegalFilePathsOnly();
Input = new Argument<FileInfo>("input_path", "Input file/folder.").LegalFilePathsOnly(); Input = new Argument<FileInfo>("input_path", "Input file/folder.").LegalFilePathsOnly();
@@ -200,7 +196,6 @@ namespace AssetStudio.CLI
UnityVersion = bindingContext.ParseResult.GetValueForOption(UnityVersion), UnityVersion = bindingContext.ParseResult.GetValueForOption(UnityVersion),
GroupAssetsType = bindingContext.ParseResult.GetValueForOption(GroupAssetsType), GroupAssetsType = bindingContext.ParseResult.GetValueForOption(GroupAssetsType),
AssetExportType = bindingContext.ParseResult.GetValueForOption(AssetExportType), AssetExportType = bindingContext.ParseResult.GetValueForOption(AssetExportType),
Model = bindingContext.ParseResult.GetValueForOption(Model),
Key = bindingContext.ParseResult.GetValueForOption(Key), Key = bindingContext.ParseResult.GetValueForOption(Key),
AIFile = bindingContext.ParseResult.GetValueForOption(AIFile), AIFile = bindingContext.ParseResult.GetValueForOption(AIFile),
DummyDllFolder = bindingContext.ParseResult.GetValueForOption(DummyDllFolder), DummyDllFolder = bindingContext.ParseResult.GetValueForOption(DummyDllFolder),

View File

@@ -366,7 +366,7 @@ namespace AssetStudio.CLI
game = Studio.Game, game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations, collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs), uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs), texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
}; };
var convert = animationList != null var convert = animationList != null
? new ModelConverter(m_Animator, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray()) ? new ModelConverter(m_Animator, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
@@ -392,7 +392,7 @@ namespace AssetStudio.CLI
game = Studio.Game, game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations, collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs), uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs), texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
}; };
var convert = animationList != null var convert = animationList != null
? new ModelConverter(gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray()) ? new ModelConverter(gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())

View File

@@ -4,6 +4,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using AssetStudio.CLI.Properties; using AssetStudio.CLI.Properties;
using Newtonsoft.Json;
using static AssetStudio.CLI.Studio; using static AssetStudio.CLI.Studio;
namespace AssetStudio.CLI namespace AssetStudio.CLI
@@ -44,10 +45,34 @@ namespace AssetStudio.CLI
AssetsHelper.Minimal = Settings.Default.minimalAssetMap; AssetsHelper.Minimal = Settings.Default.minimalAssetMap;
AssetsHelper.SetUnityVersion(o.UnityVersion); AssetsHelper.SetUnityVersion(o.UnityVersion);
if (o.TypeFilter == null)
{
TypeFlags.SetTypes(JsonConvert.DeserializeObject<Dictionary<ClassIDType, (bool, bool)>>(Settings.Default.types));
}
else
{
foreach (var type in o.TypeFilter)
{
TypeFlags.SetType(type, true, true);
}
if (ClassIDType.GameObject.CanExport() || ClassIDType.Animator.CanExport())
{
TypeFlags.SetType(ClassIDType.Texture2D, true, false);
if (ClassIDType.GameObject.CanExport())
{
TypeFlags.SetType(ClassIDType.Animator, true, false);
}
else if(ClassIDType.Animator.CanExport())
{
TypeFlags.SetType(ClassIDType.GameObject, true, false);
}
}
}
assetsManager.Silent = o.Silent; assetsManager.Silent = o.Silent;
assetsManager.Game = game; assetsManager.Game = game;
assetsManager.SpecifyUnityVersion = o.UnityVersion; assetsManager.SpecifyUnityVersion = o.UnityVersion;
ModelOnly = o.Model;
o.Output.Create(); o.Output.Create();
if (o.Key != default) if (o.Key != default)

View File

@@ -55,6 +55,7 @@ namespace AssetStudio.CLI.Properties {
public bool enableFileLogging => AppSettings.Get("enableFileLogging", false); public bool enableFileLogging => AppSettings.Get("enableFileLogging", false);
public bool minimalAssetMap => AppSettings.Get("minimalAssetMap", true); public bool minimalAssetMap => AppSettings.Get("minimalAssetMap", true);
public bool allowDuplicates => AppSettings.Get("allowDuplicates", false); public bool allowDuplicates => AppSettings.Get("allowDuplicates", false);
public string types => AppSettings.Get("types", string.Empty);
public string texs => AppSettings.Get("texs", string.Empty); public string texs => AppSettings.Get("texs", string.Empty);
public string uvs => AppSettings.Get("uvs", string.Empty); public string uvs => AppSettings.Get("uvs", string.Empty);

View File

@@ -25,7 +25,6 @@ namespace AssetStudio.CLI
internal static class Studio internal static class Studio
{ {
public static Game Game; public static Game Game;
public static bool ModelOnly = false;
public static bool SkipContainer = false; public static bool SkipContainer = false;
public static AssetsManager assetsManager = new AssetsManager() { ResolveDependencies = false }; public static AssetsManager assetsManager = new AssetsManager() { ResolveDependencies = false };
public static AssemblyLoader assemblyLoader = new AssemblyLoader(); public static AssemblyLoader assemblyLoader = new AssemblyLoader();
@@ -286,25 +285,25 @@ namespace AssetStudio.CLI
switch (asset) switch (asset)
{ {
case GameObject m_GameObject: case GameObject m_GameObject:
exportable = ModelOnly && m_GameObject.HasModel(); exportable = ClassIDType.GameObject.CanExport() && m_GameObject.HasModel();
break; break;
case Texture2D m_Texture2D: case Texture2D m_Texture2D:
if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path)) if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path))
assetItem.FullSize = asset.byteSize + m_Texture2D.m_StreamData.size; assetItem.FullSize = asset.byteSize + m_Texture2D.m_StreamData.size;
exportable = !ModelOnly; exportable = ClassIDType.Texture2D.CanExport();
break; break;
case AudioClip m_AudioClip: case AudioClip m_AudioClip:
if (!string.IsNullOrEmpty(m_AudioClip.m_Source)) if (!string.IsNullOrEmpty(m_AudioClip.m_Source))
assetItem.FullSize = asset.byteSize + m_AudioClip.m_Size; assetItem.FullSize = asset.byteSize + m_AudioClip.m_Size;
exportable = !ModelOnly; exportable = ClassIDType.AudioClip.CanExport();
break; break;
case VideoClip m_VideoClip: case VideoClip m_VideoClip:
if (!string.IsNullOrEmpty(m_VideoClip.m_OriginalPath)) if (!string.IsNullOrEmpty(m_VideoClip.m_OriginalPath))
assetItem.FullSize = asset.byteSize + (long)m_VideoClip.m_ExternalResources.m_Size; assetItem.FullSize = asset.byteSize + m_VideoClip.m_ExternalResources.m_Size;
exportable = !ModelOnly; exportable = ClassIDType.VideoClip.CanExport();
break; break;
case MonoBehaviour m_MonoBehaviour: case MonoBehaviour m_MonoBehaviour:
exportable = !ModelOnly && assemblyLoader.Loaded; exportable = ClassIDType.MonoBehaviour.CanExport();
break; break;
case AssetBundle m_AssetBundle: case AssetBundle m_AssetBundle:
foreach (var m_Container in m_AssetBundle.m_Container) foreach (var m_Container in m_AssetBundle.m_Container)
@@ -317,30 +316,36 @@ namespace AssetStudio.CLI
containers.Add((m_AssetBundle.m_PreloadTable[k], m_Container.Key)); containers.Add((m_AssetBundle.m_PreloadTable[k], m_Container.Key));
} }
} }
exportable = ClassIDType.AssetBundle.CanExport();
break; break;
case IndexObject m_IndexObject: case IndexObject m_IndexObject:
foreach (var index in m_IndexObject.AssetMap) foreach (var index in m_IndexObject.AssetMap)
{ {
mihoyoBinDataNames.Add((index.Value.Object, index.Key)); mihoyoBinDataNames.Add((index.Value.Object, index.Key));
} }
exportable = ClassIDType.IndexObject.CanExport();
break; break;
case ResourceManager m_ResourceManager: case ResourceManager m_ResourceManager:
foreach (var m_Container in m_ResourceManager.m_Container) foreach (var m_Container in m_ResourceManager.m_Container)
{ {
containers.Add((m_Container.Value, m_Container.Key)); containers.Add((m_Container.Value, m_Container.Key));
} }
exportable = ClassIDType.GameObject.CanExport();
break; break;
case Mesh _: case Mesh _ when ClassIDType.Mesh.CanExport():
case TextAsset _: case TextAsset _ when ClassIDType.TextAsset.CanExport():
case AnimationClip _: case AnimationClip _ when ClassIDType.Font.CanExport():
case Font _: case Font _ when ClassIDType.GameObject.CanExport():
case MovieTexture _: case MovieTexture _ when ClassIDType.MovieTexture.CanExport():
case Sprite _: case Sprite _ when ClassIDType.Sprite.CanExport():
case Material _: case Material _ when ClassIDType.Material.CanExport():
case MiHoYoBinData _: case MiHoYoBinData _ when ClassIDType.MiHoYoBinData.CanExport():
case Shader _: case Shader _ when ClassIDType.Shader.CanExport():
case Animator _: case Animator _ when ClassIDType.Animator.CanExport():
exportable = !ModelOnly; exportable = true;
break; break;
} }
if (assetItem.Text == "") if (assetItem.Text == "")

View File

@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> <TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>1.00.00</Version> <Version>1.36.00</Version>
<AssemblyVersion>1.00.00</AssemblyVersion> <AssemblyVersion>1.36.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion> <FileVersion>1.36.00</FileVersion>
<Copyright>Copyright © Perfare 2018-2022; Copyright © hozuki 2020</Copyright> <Copyright>Copyright © Perfare 2018-2022; Copyright © hozuki 2020</Copyright>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
</PropertyGroup> </PropertyGroup>

View File

@@ -107,11 +107,14 @@
<value>True</value> <value>True</value>
</setting> </setting>
<setting name="texs" serializeAs="String"> <setting name="texs" serializeAs="String">
<value>{}</value> <value>{"0": "", "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": ""}</value>
</setting> </setting>
<setting name="uvs" serializeAs="String"> <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> <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>
<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="allowDuplicates" serializeAs="String"> <setting name="allowDuplicates" serializeAs="String">
<value>False</value> <value>False</value>
</setting> </setting>

View File

@@ -2,12 +2,12 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows;net7.0-windows</TargetFrameworks> <TargetFrameworks>net7.0-windows;net8.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Resources\as.ico</ApplicationIcon> <ApplicationIcon>Resources\as.ico</ApplicationIcon>
<Version>1.00.00</Version> <Version>1.36.00</Version>
<AssemblyVersion>1.00.00</AssemblyVersion> <AssemblyVersion>1.36.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion> <FileVersion>1.36.00</FileVersion>
<Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright> <Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
</PropertyGroup> </PropertyGroup>

View File

@@ -34,22 +34,20 @@ namespace AssetStudio.GUI
private void InitializeComponent() private void InitializeComponent()
{ {
components = new System.ComponentModel.Container(); components = new System.ComponentModel.Container();
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(); OKbutton = new Button();
Cancel = new Button(); Cancel = new Button();
groupBox1 = new GroupBox(); groupBox1 = new GroupBox();
texNameTextBox = new TextBox();
label10 = new Label();
texTypeComboBox = new ComboBox();
uvTypesComboBox = new ComboBox();
uvEnabledCheckBox = new CheckBox();
uvsComboBox = new ComboBox();
canExportCheckBox = new CheckBox();
label8 = new Label();
canParseCheckBox = new CheckBox();
typesComboBox = new ComboBox();
label6 = new Label(); label6 = new Label();
uvsGridView = new DataGridView();
UVName = new DataGridViewTextBoxColumn();
UVEnabled = new DataGridViewCheckBoxColumn();
UVType = new DataGridViewComboBoxColumn();
minimalAssetMap = new CheckBox(); minimalAssetMap = new CheckBox();
assetGroupOptions = new ComboBox(); assetGroupOptions = new ComboBox();
label7 = new Label(); label7 = new Label();
@@ -66,10 +64,6 @@ namespace AssetStudio.GUI
converttexture = new CheckBox(); converttexture = new CheckBox();
collectAnimations = new CheckBox(); collectAnimations = new CheckBox();
groupBox2 = new GroupBox(); groupBox2 = new GroupBox();
label9 = new Label();
texsGridView = new DataGridView();
TexName = new DataGridViewTextBoxColumn();
TexType = new DataGridViewComboBoxColumn();
exportBlendShape = new CheckBox(); exportBlendShape = new CheckBox();
exportAnimations = new CheckBox(); exportAnimations = new CheckBox();
scaleFactor = new NumericUpDown(); scaleFactor = new NumericUpDown();
@@ -89,11 +83,9 @@ namespace AssetStudio.GUI
exportUvsTooltip = new ToolTip(components); exportUvsTooltip = new ToolTip(components);
keyToolTip = new ToolTip(components); keyToolTip = new ToolTip(components);
groupBox1.SuspendLayout(); groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)uvsGridView).BeginInit();
((System.ComponentModel.ISupportInitialize)key).BeginInit(); ((System.ComponentModel.ISupportInitialize)key).BeginInit();
panel1.SuspendLayout(); panel1.SuspendLayout();
groupBox2.SuspendLayout(); groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)texsGridView).BeginInit();
((System.ComponentModel.ISupportInitialize)scaleFactor).BeginInit(); ((System.ComponentModel.ISupportInitialize)scaleFactor).BeginInit();
((System.ComponentModel.ISupportInitialize)boneSize).BeginInit(); ((System.ComponentModel.ISupportInitialize)boneSize).BeginInit();
((System.ComponentModel.ISupportInitialize)filterPrecision).BeginInit(); ((System.ComponentModel.ISupportInitialize)filterPrecision).BeginInit();
@@ -101,7 +93,7 @@ namespace AssetStudio.GUI
// //
// OKbutton // OKbutton
// //
OKbutton.Location = new System.Drawing.Point(480, 439); OKbutton.Location = new System.Drawing.Point(480, 428);
OKbutton.Margin = new Padding(4); OKbutton.Margin = new Padding(4);
OKbutton.Name = "OKbutton"; OKbutton.Name = "OKbutton";
OKbutton.Size = new System.Drawing.Size(88, 26); OKbutton.Size = new System.Drawing.Size(88, 26);
@@ -113,7 +105,7 @@ namespace AssetStudio.GUI
// Cancel // Cancel
// //
Cancel.DialogResult = DialogResult.Cancel; Cancel.DialogResult = DialogResult.Cancel;
Cancel.Location = new System.Drawing.Point(576, 439); Cancel.Location = new System.Drawing.Point(576, 428);
Cancel.Margin = new Padding(4); Cancel.Margin = new Padding(4);
Cancel.Name = "Cancel"; Cancel.Name = "Cancel";
Cancel.Size = new System.Drawing.Size(88, 26); Cancel.Size = new System.Drawing.Size(88, 26);
@@ -125,8 +117,17 @@ namespace AssetStudio.GUI
// groupBox1 // groupBox1
// //
groupBox1.AutoSize = true; groupBox1.AutoSize = true;
groupBox1.Controls.Add(texNameTextBox);
groupBox1.Controls.Add(label10);
groupBox1.Controls.Add(texTypeComboBox);
groupBox1.Controls.Add(uvTypesComboBox);
groupBox1.Controls.Add(uvEnabledCheckBox);
groupBox1.Controls.Add(uvsComboBox);
groupBox1.Controls.Add(canExportCheckBox);
groupBox1.Controls.Add(label8);
groupBox1.Controls.Add(canParseCheckBox);
groupBox1.Controls.Add(typesComboBox);
groupBox1.Controls.Add(label6); groupBox1.Controls.Add(label6);
groupBox1.Controls.Add(uvsGridView);
groupBox1.Controls.Add(minimalAssetMap); groupBox1.Controls.Add(minimalAssetMap);
groupBox1.Controls.Add(assetGroupOptions); groupBox1.Controls.Add(assetGroupOptions);
groupBox1.Controls.Add(label7); groupBox1.Controls.Add(label7);
@@ -141,56 +142,125 @@ namespace AssetStudio.GUI
groupBox1.Margin = new Padding(4); groupBox1.Margin = new Padding(4);
groupBox1.Name = "groupBox1"; groupBox1.Name = "groupBox1";
groupBox1.Padding = new Padding(4); groupBox1.Padding = new Padding(4);
groupBox1.Size = new System.Drawing.Size(271, 419); groupBox1.Size = new System.Drawing.Size(271, 420);
groupBox1.TabIndex = 9; groupBox1.TabIndex = 9;
groupBox1.TabStop = false; groupBox1.TabStop = false;
groupBox1.Text = "Export"; groupBox1.Text = "Export";
// //
// texNameTextBox
//
texNameTextBox.Location = new System.Drawing.Point(119, 374);
texNameTextBox.Name = "texNameTextBox";
texNameTextBox.Size = new System.Drawing.Size(141, 23);
texNameTextBox.TabIndex = 37;
texNameTextBox.LostFocus += TexNameTextBox_LostFocus;
//
// label10
//
label10.AutoSize = true;
label10.Location = new System.Drawing.Point(7, 356);
label10.Margin = new Padding(4, 0, 4, 0);
label10.Name = "label10";
label10.Size = new System.Drawing.Size(142, 15);
label10.TabIndex = 36;
label10.Text = "Texture mapping options:";
//
// texTypeComboBox
//
texTypeComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
texTypeComboBox.FormattingEnabled = true;
texTypeComboBox.Items.AddRange(new object[] { "Diffuse", "NormalMap", "Specular", "Bump", "Ambient", "Emissive", "Reflection", "Displacement" });
texTypeComboBox.Location = new System.Drawing.Point(7, 374);
texTypeComboBox.Name = "texTypeComboBox";
texTypeComboBox.Size = new System.Drawing.Size(106, 23);
texTypeComboBox.TabIndex = 35;
texTypeComboBox.SelectedIndexChanged += TexTypeComboBox_SelectedIndexChanged;
//
// uvTypesComboBox
//
uvTypesComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
uvTypesComboBox.FormattingEnabled = true;
uvTypesComboBox.Items.AddRange(new object[] { "Diffuse", "NormalMap", "Specular", "Bump", "Ambient", "Emissive", "Reflection", "Displacement" });
uvTypesComboBox.Location = new System.Drawing.Point(88, 330);
uvTypesComboBox.Name = "uvTypesComboBox";
uvTypesComboBox.Size = new System.Drawing.Size(106, 23);
uvTypesComboBox.TabIndex = 34;
uvTypesComboBox.SelectedIndexChanged += uvTypesComboBox_SelectedIndexChanged;
//
// uvEnabledCheckBox
//
uvEnabledCheckBox.AutoSize = true;
uvEnabledCheckBox.Location = new System.Drawing.Point(200, 334);
uvEnabledCheckBox.Name = "uvEnabledCheckBox";
uvEnabledCheckBox.Size = new System.Drawing.Size(60, 19);
uvEnabledCheckBox.TabIndex = 33;
uvEnabledCheckBox.Text = "Export";
uvEnabledCheckBox.UseVisualStyleBackColor = true;
uvEnabledCheckBox.CheckedChanged += uvEnabledCheckBox_CheckedChanged;
//
// uvsComboBox
//
uvsComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
uvsComboBox.FormattingEnabled = true;
uvsComboBox.Items.AddRange(new object[] { "UV0", "UV1", "UV2", "UV3", "UV4", "UV5", "UV6", "UV7" });
uvsComboBox.Location = new System.Drawing.Point(7, 330);
uvsComboBox.Name = "uvsComboBox";
uvsComboBox.Size = new System.Drawing.Size(75, 23);
uvsComboBox.TabIndex = 32;
uvsComboBox.SelectedIndexChanged += uvsComboBox_SelectedIndexChanged;
//
// canExportCheckBox
//
canExportCheckBox.AutoSize = true;
canExportCheckBox.Location = new System.Drawing.Point(200, 290);
canExportCheckBox.Name = "canExportCheckBox";
canExportCheckBox.Size = new System.Drawing.Size(60, 19);
canExportCheckBox.TabIndex = 31;
canExportCheckBox.Text = "Export";
canExportCheckBox.UseVisualStyleBackColor = true;
canExportCheckBox.CheckedChanged += CanExportCheckBox_CheckedChanged;
//
// label8
//
label8.AutoSize = true;
label8.Location = new System.Drawing.Point(7, 268);
label8.Margin = new Padding(4, 0, 4, 0);
label8.Name = "label8";
label8.Size = new System.Drawing.Size(132, 15);
label8.TabIndex = 30;
label8.Text = "Selected unity type can:";
//
// canParseCheckBox
//
canParseCheckBox.AutoSize = true;
canParseCheckBox.Location = new System.Drawing.Point(140, 290);
canParseCheckBox.Name = "canParseCheckBox";
canParseCheckBox.Size = new System.Drawing.Size(54, 19);
canParseCheckBox.TabIndex = 29;
canParseCheckBox.Text = "Parse";
canParseCheckBox.UseVisualStyleBackColor = true;
canParseCheckBox.CheckedChanged += CanParseCheckBox_CheckedChanged;
//
// typesComboBox
//
typesComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
typesComboBox.FormattingEnabled = true;
typesComboBox.Items.AddRange(new object[] { ClassIDType.Animation, ClassIDType.AnimationClip, ClassIDType.Animator, ClassIDType.AnimatorController, ClassIDType.AnimatorOverrideController, ClassIDType.AssetBundle, ClassIDType.AudioClip, ClassIDType.Avatar, ClassIDType.Font, ClassIDType.GameObject, ClassIDType.IndexObject, ClassIDType.Material, ClassIDType.Mesh, ClassIDType.MeshFilter, ClassIDType.MeshRenderer, ClassIDType.MiHoYoBinData, ClassIDType.MonoBehaviour, ClassIDType.MonoScript, ClassIDType.MovieTexture, ClassIDType.PlayerSettings, ClassIDType.RectTransform, ClassIDType.Shader, ClassIDType.SkinnedMeshRenderer, ClassIDType.Sprite, ClassIDType.SpriteAtlas, ClassIDType.TextAsset, ClassIDType.Texture2D, ClassIDType.Transform, ClassIDType.VideoClip, ClassIDType.ResourceManager });
typesComboBox.Location = new System.Drawing.Point(7, 286);
typesComboBox.Name = "typesComboBox";
typesComboBox.Size = new System.Drawing.Size(127, 23);
typesComboBox.TabIndex = 28;
typesComboBox.SelectedIndexChanged += TypesComboBox_SelectedIndexChanged;
//
// label6 // label6
// //
label6.AutoSize = true; label6.AutoSize = true;
label6.Location = new System.Drawing.Point(101, 275); label6.Location = new System.Drawing.Point(9, 312);
label6.Margin = new Padding(4, 0, 4, 0); label6.Margin = new Padding(4, 0, 4, 0);
label6.Name = "label6"; label6.Name = "label6";
label6.Size = new System.Drawing.Size(73, 15); label6.Size = new System.Drawing.Size(119, 15);
label6.TabIndex = 27; label6.TabIndex = 27;
label6.Text = "UV Mapping"; label6.Text = "UV mapping options:";
//
// 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
// //
@@ -373,8 +443,6 @@ namespace AssetStudio.GUI
// groupBox2 // groupBox2
// //
groupBox2.AutoSize = true; groupBox2.AutoSize = true;
groupBox2.Controls.Add(label9);
groupBox2.Controls.Add(texsGridView);
groupBox2.Controls.Add(collectAnimations); groupBox2.Controls.Add(collectAnimations);
groupBox2.Controls.Add(exportBlendShape); groupBox2.Controls.Add(exportBlendShape);
groupBox2.Controls.Add(exportAnimations); groupBox2.Controls.Add(exportAnimations);
@@ -396,80 +464,11 @@ namespace AssetStudio.GUI
groupBox2.Margin = new Padding(4); groupBox2.Margin = new Padding(4);
groupBox2.Name = "groupBox2"; groupBox2.Name = "groupBox2";
groupBox2.Padding = new Padding(4); groupBox2.Padding = new Padding(4);
groupBox2.Size = new System.Drawing.Size(379, 419); groupBox2.Size = new System.Drawing.Size(380, 236);
groupBox2.TabIndex = 11; groupBox2.TabIndex = 11;
groupBox2.TabStop = false; groupBox2.TabStop = false;
groupBox2.Text = "Fbx"; groupBox2.Text = "Fbx";
// //
// label9
//
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";
//
// texsGridView
//
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
// //
exportBlendShape.AutoSize = true; exportBlendShape.AutoSize = true;
@@ -500,7 +499,7 @@ namespace AssetStudio.GUI
// //
scaleFactor.DecimalPlaces = 2; scaleFactor.DecimalPlaces = 2;
scaleFactor.Increment = new decimal(new int[] { 1, 0, 0, 131072 }); scaleFactor.Increment = new decimal(new int[] { 1, 0, 0, 131072 });
scaleFactor.Location = new System.Drawing.Point(103, 185); scaleFactor.Location = new System.Drawing.Point(102, 189);
scaleFactor.Margin = new Padding(4); scaleFactor.Margin = new Padding(4);
scaleFactor.Name = "scaleFactor"; scaleFactor.Name = "scaleFactor";
scaleFactor.Size = new System.Drawing.Size(59, 23); scaleFactor.Size = new System.Drawing.Size(59, 23);
@@ -511,7 +510,7 @@ namespace AssetStudio.GUI
// label5 // label5
// //
label5.AutoSize = true; label5.AutoSize = true;
label5.Location = new System.Drawing.Point(9, 189); label5.Location = new System.Drawing.Point(8, 193);
label5.Margin = new Padding(4, 0, 4, 0); label5.Margin = new Padding(4, 0, 4, 0);
label5.Name = "label5"; label5.Name = "label5";
label5.Size = new System.Drawing.Size(67, 15); label5.Size = new System.Drawing.Size(67, 15);
@@ -523,7 +522,7 @@ namespace AssetStudio.GUI
fbxFormat.DropDownStyle = ComboBoxStyle.DropDownList; fbxFormat.DropDownStyle = ComboBoxStyle.DropDownList;
fbxFormat.FormattingEnabled = true; fbxFormat.FormattingEnabled = true;
fbxFormat.Items.AddRange(new object[] { "Binary", "Ascii" }); fbxFormat.Items.AddRange(new object[] { "Binary", "Ascii" });
fbxFormat.Location = new System.Drawing.Point(272, 121); fbxFormat.Location = new System.Drawing.Point(271, 125);
fbxFormat.Margin = new Padding(4); fbxFormat.Margin = new Padding(4);
fbxFormat.Name = "fbxFormat"; fbxFormat.Name = "fbxFormat";
fbxFormat.Size = new System.Drawing.Size(70, 23); fbxFormat.Size = new System.Drawing.Size(70, 23);
@@ -532,7 +531,7 @@ namespace AssetStudio.GUI
// label4 // label4
// //
label4.AutoSize = true; label4.AutoSize = true;
label4.Location = new System.Drawing.Point(189, 125); label4.Location = new System.Drawing.Point(188, 129);
label4.Margin = new Padding(4, 0, 4, 0); label4.Margin = new Padding(4, 0, 4, 0);
label4.Name = "label4"; label4.Name = "label4";
label4.Size = new System.Drawing.Size(65, 15); label4.Size = new System.Drawing.Size(65, 15);
@@ -544,7 +543,7 @@ namespace AssetStudio.GUI
fbxVersion.DropDownStyle = ComboBoxStyle.DropDownList; fbxVersion.DropDownStyle = ComboBoxStyle.DropDownList;
fbxVersion.FormattingEnabled = true; fbxVersion.FormattingEnabled = true;
fbxVersion.Items.AddRange(new object[] { "6.1", "7.1", "7.2", "7.3", "7.4", "7.5" }); fbxVersion.Items.AddRange(new object[] { "6.1", "7.1", "7.2", "7.3", "7.4", "7.5" });
fbxVersion.Location = new System.Drawing.Point(272, 153); fbxVersion.Location = new System.Drawing.Point(271, 157);
fbxVersion.Margin = new Padding(4); fbxVersion.Margin = new Padding(4);
fbxVersion.Name = "fbxVersion"; fbxVersion.Name = "fbxVersion";
fbxVersion.Size = new System.Drawing.Size(70, 23); fbxVersion.Size = new System.Drawing.Size(70, 23);
@@ -553,7 +552,7 @@ namespace AssetStudio.GUI
// label3 // label3
// //
label3.AutoSize = true; label3.AutoSize = true;
label3.Location = new System.Drawing.Point(189, 157); label3.Location = new System.Drawing.Point(188, 161);
label3.Margin = new Padding(4, 0, 4, 0); label3.Margin = new Padding(4, 0, 4, 0);
label3.Name = "label3"; label3.Name = "label3";
label3.Size = new System.Drawing.Size(65, 15); label3.Size = new System.Drawing.Size(65, 15);
@@ -562,7 +561,7 @@ namespace AssetStudio.GUI
// //
// boneSize // boneSize
// //
boneSize.Location = new System.Drawing.Point(103, 153); boneSize.Location = new System.Drawing.Point(102, 157);
boneSize.Margin = new Padding(4); boneSize.Margin = new Padding(4);
boneSize.Name = "boneSize"; boneSize.Name = "boneSize";
boneSize.Size = new System.Drawing.Size(59, 23); boneSize.Size = new System.Drawing.Size(59, 23);
@@ -572,7 +571,7 @@ namespace AssetStudio.GUI
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new System.Drawing.Point(9, 157); label2.Location = new System.Drawing.Point(8, 161);
label2.Margin = new Padding(4, 0, 4, 0); label2.Margin = new Padding(4, 0, 4, 0);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new System.Drawing.Size(54, 15); label2.Size = new System.Drawing.Size(54, 15);
@@ -584,7 +583,7 @@ namespace AssetStudio.GUI
exportSkins.AutoSize = true; exportSkins.AutoSize = true;
exportSkins.Checked = true; exportSkins.Checked = true;
exportSkins.CheckState = CheckState.Checked; exportSkins.CheckState = CheckState.Checked;
exportSkins.Location = new System.Drawing.Point(94, 17); exportSkins.Location = new System.Drawing.Point(154, 17);
exportSkins.Margin = new Padding(4); exportSkins.Margin = new Padding(4);
exportSkins.Name = "exportSkins"; exportSkins.Name = "exportSkins";
exportSkins.Size = new System.Drawing.Size(89, 19); exportSkins.Size = new System.Drawing.Size(89, 19);
@@ -595,7 +594,7 @@ namespace AssetStudio.GUI
// label1 // label1
// //
label1.AutoSize = true; label1.AutoSize = true;
label1.Location = new System.Drawing.Point(9, 125); label1.Location = new System.Drawing.Point(8, 129);
label1.Margin = new Padding(4, 0, 4, 0); label1.Margin = new Padding(4, 0, 4, 0);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new System.Drawing.Size(81, 15); label1.Size = new System.Drawing.Size(81, 15);
@@ -606,7 +605,7 @@ namespace AssetStudio.GUI
// //
filterPrecision.DecimalPlaces = 2; filterPrecision.DecimalPlaces = 2;
filterPrecision.Increment = new decimal(new int[] { 1, 0, 0, 131072 }); filterPrecision.Increment = new decimal(new int[] { 1, 0, 0, 131072 });
filterPrecision.Location = new System.Drawing.Point(103, 123); filterPrecision.Location = new System.Drawing.Point(102, 127);
filterPrecision.Margin = new Padding(4); filterPrecision.Margin = new Padding(4);
filterPrecision.Name = "filterPrecision"; filterPrecision.Name = "filterPrecision";
filterPrecision.Size = new System.Drawing.Size(59, 23); filterPrecision.Size = new System.Drawing.Size(59, 23);
@@ -629,7 +628,7 @@ namespace AssetStudio.GUI
exportAllNodes.AutoSize = true; exportAllNodes.AutoSize = true;
exportAllNodes.Checked = true; exportAllNodes.Checked = true;
exportAllNodes.CheckState = CheckState.Checked; exportAllNodes.CheckState = CheckState.Checked;
exportAllNodes.Location = new System.Drawing.Point(191, 17); exportAllNodes.Location = new System.Drawing.Point(7, 96);
exportAllNodes.Margin = new Padding(4); exportAllNodes.Margin = new Padding(4);
exportAllNodes.Name = "exportAllNodes"; exportAllNodes.Name = "exportAllNodes";
exportAllNodes.Size = new System.Drawing.Size(110, 19); exportAllNodes.Size = new System.Drawing.Size(110, 19);
@@ -656,7 +655,7 @@ namespace AssetStudio.GUI
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
CancelButton = Cancel; CancelButton = Cancel;
ClientSize = new System.Drawing.Size(677, 480); ClientSize = new System.Drawing.Size(677, 467);
Controls.Add(groupBox2); Controls.Add(groupBox2);
Controls.Add(groupBox1); Controls.Add(groupBox1);
Controls.Add(Cancel); Controls.Add(Cancel);
@@ -673,13 +672,11 @@ namespace AssetStudio.GUI
TopMost = true; TopMost = true;
groupBox1.ResumeLayout(false); groupBox1.ResumeLayout(false);
groupBox1.PerformLayout(); groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)uvsGridView).EndInit();
((System.ComponentModel.ISupportInitialize)key).EndInit(); ((System.ComponentModel.ISupportInitialize)key).EndInit();
panel1.ResumeLayout(false); panel1.ResumeLayout(false);
panel1.PerformLayout(); panel1.PerformLayout();
groupBox2.ResumeLayout(false); groupBox2.ResumeLayout(false);
groupBox2.PerformLayout(); groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)texsGridView).EndInit();
((System.ComponentModel.ISupportInitialize)scaleFactor).EndInit(); ((System.ComponentModel.ISupportInitialize)scaleFactor).EndInit();
((System.ComponentModel.ISupportInitialize)boneSize).EndInit(); ((System.ComponentModel.ISupportInitialize)boneSize).EndInit();
((System.ComponentModel.ISupportInitialize)filterPrecision).EndInit(); ((System.ComponentModel.ISupportInitialize)filterPrecision).EndInit();
@@ -725,14 +722,16 @@ namespace AssetStudio.GUI
private System.Windows.Forms.ToolTip keyToolTip; private System.Windows.Forms.ToolTip keyToolTip;
private System.Windows.Forms.CheckBox minimalAssetMap; private System.Windows.Forms.CheckBox minimalAssetMap;
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.DataGridView texsGridView;
private Label label9;
private DataGridViewTextBoxColumn TexName;
private DataGridViewComboBoxColumn TexType;
private Label label6; private Label label6;
private DataGridView uvsGridView; private Label label8;
private DataGridViewTextBoxColumn UVName; private CheckBox canParseCheckBox;
private DataGridViewCheckBoxColumn UVEnabled; private ComboBox typesComboBox;
private DataGridViewComboBoxColumn UVType; private CheckBox canExportCheckBox;
private ComboBox uvTypesComboBox;
private CheckBox uvEnabledCheckBox;
private ComboBox uvsComboBox;
private Label label10;
private ComboBox texTypeComboBox;
private TextBox texNameTextBox;
} }
} }

View File

@@ -8,17 +8,9 @@ namespace AssetStudio.GUI
{ {
public partial class ExportOptions : Form public partial class ExportOptions : Form
{ {
private Dictionary<int, string> typeMap = new Dictionary<int, string>() private Dictionary<ClassIDType, (bool, bool)> types = new Dictionary<ClassIDType, (bool, bool)>();
{ private Dictionary<string, (bool, int)> uvs = new Dictionary<string, (bool, int)>();
{ 0, "Diffuse" }, private Dictionary<int, string> texs = new Dictionary<int, string>();
{ 1, "NormalMap" },
{ 2, "Specular" },
{ 3, "Bump" },
{ 4, "Ambient" },
{ 5, "Emissive" },
{ 6, "Reflection" },
{ 7, "Displacement" },
};
public ExportOptions() public ExportOptions()
{ {
InitializeComponent(); InitializeComponent();
@@ -51,23 +43,12 @@ namespace AssetStudio.GUI
encrypted.Checked = Properties.Settings.Default.encrypted; encrypted.Checked = Properties.Settings.Default.encrypted;
key.Value = Properties.Settings.Default.key; key.Value = Properties.Settings.Default.key;
minimalAssetMap.Checked = Properties.Settings.Default.minimalAssetMap; minimalAssetMap.Checked = Properties.Settings.Default.minimalAssetMap;
var uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs); types = JsonConvert.DeserializeObject<Dictionary<ClassIDType, (bool, bool)>>(Properties.Settings.Default.types);
foreach (var uv in uvs) uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs);
{ texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs);
var rowIdx = uvsGridView.Rows.Add(); typesComboBox.SelectedIndex = 0;
uvsComboBox.SelectedIndex = 0;
uvsGridView.Rows[rowIdx].Cells["UVName"].Value = uv.Key; texTypeComboBox.SelectedIndex = 0;
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) private void OKbutton_Click(object sender, EventArgs e)
@@ -100,33 +81,88 @@ namespace AssetStudio.GUI
Properties.Settings.Default.encrypted = encrypted.Checked; Properties.Settings.Default.encrypted = encrypted.Checked;
Properties.Settings.Default.key = (byte)key.Value; Properties.Settings.Default.key = (byte)key.Value;
Properties.Settings.Default.minimalAssetMap = minimalAssetMap.Checked; Properties.Settings.Default.minimalAssetMap = minimalAssetMap.Checked;
var uvs = new Dictionary<string, (bool, int)>(); Properties.Settings.Default.types = JsonConvert.SerializeObject(types);
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); 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.texs = JsonConvert.SerializeObject(texs);
Properties.Settings.Default.Save(); Properties.Settings.Default.Save();
MiHoYoBinData.Key = (byte)key.Value; MiHoYoBinData.Key = (byte)key.Value;
MiHoYoBinData.Encrypted = encrypted.Checked; MiHoYoBinData.Encrypted = encrypted.Checked;
AssetsHelper.Minimal = Properties.Settings.Default.minimalAssetMap; AssetsHelper.Minimal = Properties.Settings.Default.minimalAssetMap;
TypeFlags.SetTypes(types);
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();
} }
private void TypesComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (sender is ComboBox comboBox && types.TryGetValue((ClassIDType)comboBox.SelectedItem, out var param))
{
canParseCheckBox.Checked = param.Item1;
canExportCheckBox.Checked = param.Item2;
}
}
private void CanParseCheckBox_CheckedChanged(object sender, EventArgs e)
{
if (sender is CheckBox checkBox && types.TryGetValue((ClassIDType)typesComboBox.SelectedItem, out var param))
{
param.Item1 = checkBox.Checked;
types[(ClassIDType)typesComboBox.SelectedItem] = (param.Item1, param.Item2);
}
}
private void CanExportCheckBox_CheckedChanged(object sender, EventArgs e)
{
if (sender is CheckBox checkBox && types.TryGetValue((ClassIDType)typesComboBox.SelectedItem, out var param))
{
param.Item2 = checkBox.Checked;
types[(ClassIDType)typesComboBox.SelectedItem] = (param.Item1, param.Item2);
}
}
private void uvsComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (sender is ComboBox comboBox && uvs.TryGetValue(comboBox.SelectedItem.ToString(), out var param))
{
uvEnabledCheckBox.Checked = param.Item1;
uvTypesComboBox.SelectedIndex = param.Item2;
}
}
private void uvEnabledCheckBox_CheckedChanged(object sender, EventArgs e)
{
if (sender is CheckBox checkBox && uvs.TryGetValue(uvsComboBox.SelectedItem.ToString(), out var param))
{
param.Item1 = checkBox.Checked;
uvs[uvsComboBox.SelectedItem.ToString()] = (param.Item1, param.Item2);
}
}
private void uvTypesComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (sender is ComboBox comboBox && uvs.TryGetValue(uvsComboBox.SelectedItem.ToString(), out var param))
{
param.Item2 = comboBox.SelectedIndex;
uvs[uvsComboBox.SelectedItem.ToString()] = (param.Item1, param.Item2);
}
}
private void TexTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (sender is ComboBox comboBox && texs.TryGetValue(comboBox.SelectedIndex, out var name))
{
texNameTextBox.Text = name;
}
}
private void TexNameTextBox_LostFocus(object sender, EventArgs e)
{
if (sender is TextBox textBox && texs.ContainsKey(texTypeComboBox.SelectedIndex))
{
texs[texTypeComboBox.SelectedIndex] = textBox.Text;
}
}
private void Cancel_Click(object sender, EventArgs e) private void Cancel_Click(object sender, EventArgs e)
{ {
DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;

View File

@@ -117,15 +117,6 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<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"> <metadata name="keyToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>162, 17</value> <value>162, 17</value>
</metadata> </metadata>

View File

@@ -365,7 +365,7 @@ namespace AssetStudio.GUI
game = Studio.Game, game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations, collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs), uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs), texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
}; };
var convert = animationList != null var convert = animationList != null
? new ModelConverter(m_Animator, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray()) ? new ModelConverter(m_Animator, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
@@ -391,7 +391,7 @@ namespace AssetStudio.GUI
game = Studio.Game, game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations, collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs), uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs), texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
}; };
var convert = animationList != null var convert = animationList != null
? new ModelConverter(gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray()) ? new ModelConverter(gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
@@ -416,7 +416,7 @@ namespace AssetStudio.GUI
game = Studio.Game, game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations, collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs), uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs), texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
}; };
var convert = animationList != null var convert = animationList != null
? new ModelConverter(rootName, gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray()) ? new ModelConverter(rootName, gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())

View File

@@ -160,6 +160,7 @@ namespace AssetStudio.GUI
specifyGame.SelectedIndex = Properties.Settings.Default.selectedGame; specifyGame.SelectedIndex = Properties.Settings.Default.selectedGame;
specifyGame.SelectedIndexChanged += new EventHandler(specifyGame_SelectedIndexChanged); specifyGame.SelectedIndexChanged += new EventHandler(specifyGame_SelectedIndexChanged);
Studio.Game = GameManager.GetGame(Properties.Settings.Default.selectedGame); Studio.Game = GameManager.GetGame(Properties.Settings.Default.selectedGame);
TypeFlags.SetTypes(JsonConvert.DeserializeObject<Dictionary<ClassIDType, (bool, bool)>>(Properties.Settings.Default.types));
Logger.Info($"Target Game type is {Studio.Game.Type}"); Logger.Info($"Target Game type is {Studio.Game.Type}");
if (Studio.Game.Type.IsUnityCN()) if (Studio.Game.Type.IsUnityCN())
@@ -175,6 +176,10 @@ namespace AssetStudio.GUI
Properties.Settings.Default.selectedCABMapName = ""; Properties.Settings.Default.selectedCABMapName = "";
Properties.Settings.Default.Save(); Properties.Settings.Default.Save();
} }
else
{
MapNameComboBox.Text = Properties.Settings.Default.selectedCABMapName;
}
} }
} }
private void MainForm_DragEnter(object sender, DragEventArgs e) private void MainForm_DragEnter(object sender, DragEventArgs e)
@@ -1303,7 +1308,7 @@ namespace AssetStudio.GUI
game = Studio.Game, game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations, collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs), uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs), texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
}; };
var model = new ModelConverter(m_GameObject, options, Array.Empty<AnimationClip>()); var model = new ModelConverter(m_GameObject, options, Array.Empty<AnimationClip>());
PreviewModel(model); PreviewModel(model);
@@ -1316,7 +1321,7 @@ namespace AssetStudio.GUI
game = Studio.Game, game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations, collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs), uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs), texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
}; };
var model = new ModelConverter(m_Animator, options, Array.Empty<AnimationClip>()); var model = new ModelConverter(m_Animator, options, Array.Empty<AnimationClip>());
PreviewModel(model); PreviewModel(model);

View File

@@ -481,5 +481,17 @@ namespace AssetStudio.GUI.Properties {
this["loggerEventType"] = value; this["loggerEventType"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"{""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}}")]
public string types {
get {
return ((string)(this["types"]));
}
set {
this["types"] = value;
}
}
} }
} }

View File

@@ -116,5 +116,8 @@
<Setting Name="loggerEventType" Type="System.Int32" Scope="User"> <Setting Name="loggerEventType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">30</Value> <Value Profile="(Default)">30</Value>
</Setting> </Setting>
<Setting Name="types" Type="System.String" Scope="User">
<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>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@@ -257,20 +257,21 @@ namespace AssetStudio.GUI
case Texture2D m_Texture2D: case Texture2D m_Texture2D:
if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path)) if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path))
assetItem.FullSize = asset.byteSize + m_Texture2D.m_StreamData.size; assetItem.FullSize = asset.byteSize + m_Texture2D.m_StreamData.size;
exportable = true; exportable = ClassIDType.Texture2D.CanExport();
break; break;
case AudioClip m_AudioClip: case AudioClip m_AudioClip:
if (!string.IsNullOrEmpty(m_AudioClip.m_Source)) if (!string.IsNullOrEmpty(m_AudioClip.m_Source))
assetItem.FullSize = asset.byteSize + m_AudioClip.m_Size; assetItem.FullSize = asset.byteSize + m_AudioClip.m_Size;
exportable = true; exportable = ClassIDType.AudioClip.CanExport();
break; break;
case VideoClip m_VideoClip: case VideoClip m_VideoClip:
if (!string.IsNullOrEmpty(m_VideoClip.m_OriginalPath)) if (!string.IsNullOrEmpty(m_VideoClip.m_OriginalPath))
assetItem.FullSize = asset.byteSize + (long)m_VideoClip.m_ExternalResources.m_Size; assetItem.FullSize = asset.byteSize + m_VideoClip.m_ExternalResources.m_Size;
exportable = true; exportable = ClassIDType.VideoClip.CanExport();
break; break;
case PlayerSettings m_PlayerSettings: case PlayerSettings m_PlayerSettings:
productName = m_PlayerSettings.productName; productName = m_PlayerSettings.productName;
exportable = ClassIDType.PlayerSettings.CanExport();
break; break;
case AssetBundle m_AssetBundle: case AssetBundle m_AssetBundle:
if (!SkipContainer) if (!SkipContainer)
@@ -286,30 +287,36 @@ namespace AssetStudio.GUI
} }
} }
} }
exportable = ClassIDType.AssetBundle.CanExport();
break; break;
case IndexObject m_IndexObject: case IndexObject m_IndexObject:
foreach(var index in m_IndexObject.AssetMap) foreach(var index in m_IndexObject.AssetMap)
{ {
mihoyoBinDataNames.Add((index.Value.Object, index.Key)); mihoyoBinDataNames.Add((index.Value.Object, index.Key));
} }
exportable = ClassIDType.IndexObject.CanExport();
break; break;
case ResourceManager m_ResourceManager: case ResourceManager m_ResourceManager:
foreach (var m_Container in m_ResourceManager.m_Container) foreach (var m_Container in m_ResourceManager.m_Container)
{ {
containers.Add((m_Container.Value, m_Container.Key)); containers.Add((m_Container.Value, m_Container.Key));
} }
exportable = ClassIDType.ResourceManager.CanExport();
break; break;
case Mesh _: case Mesh _ when ClassIDType.Mesh.CanExport():
case TextAsset _: case TextAsset _ when ClassIDType.TextAsset.CanExport():
case AnimationClip _: case AnimationClip _ when ClassIDType.AnimationClip.CanExport():
case Font _: case Font _ when ClassIDType.Font.CanExport():
case MovieTexture _: case MovieTexture _ when ClassIDType.MovieTexture.CanExport():
case Sprite _: case Sprite _ when ClassIDType.Sprite.CanExport():
case Material _: case Material _ when ClassIDType.Material.CanExport():
case MiHoYoBinData _: case MiHoYoBinData _ when ClassIDType.MiHoYoBinData.CanExport():
case Shader _: case Shader _ when ClassIDType.Shader.CanExport():
case Animator _: case Animator _ when ClassIDType.Animator.CanExport():
case MonoBehaviour _: case MonoBehaviour _ when ClassIDType.MonoBehaviour.CanExport():
exportable = true; exportable = true;
break; break;
} }

View File

@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> <TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<Version>1.00.00</Version> <Version>1.36.00</Version>
<AssemblyVersion>1.00.00</AssemblyVersion> <AssemblyVersion>1.36.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion> <FileVersion>1.36.00</FileVersion>
<Copyright>Copyright © Perfare 2020-2022; Copyright © hozuki 2020</Copyright> <Copyright>Copyright © Perfare 2020-2022; Copyright © hozuki 2020</Copyright>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
</PropertyGroup> </PropertyGroup>

View File

@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> <TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<Version>1.00.00</Version> <Version>1.36.00</Version>
<AssemblyVersion>1.00.00</AssemblyVersion> <AssemblyVersion>1.36.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion> <FileVersion>1.36.00</FileVersion>
<Copyright>Copyright © Perfare 2018-2022</Copyright> <Copyright>Copyright © Perfare 2018-2022</Copyright>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>

View File

@@ -712,8 +712,9 @@ namespace AssetStudio
iMat.Textures.Add(texture); iMat.Textures.Add(texture);
int dest = -1; int dest = -1;
if (options.texs.TryGetValue(texEnv.Key, out var targetDest)) var entry = options.texs.FirstOrDefault(x => x.Value == texEnv.Key);
dest = targetDest; if (!entry.Equals(default))
dest = entry.Key;
else if (texEnv.Key == "_MainTex") else if (texEnv.Key == "_MainTex")
dest = 0; dest = 0;
else if (texEnv.Key == "_BumpMap") else if (texEnv.Key == "_BumpMap")
@@ -1173,7 +1174,7 @@ namespace AssetStudio
public Game game; public Game game;
public bool collectAnimations; public bool collectAnimations;
public Dictionary<string, (bool, int)> uvs; public Dictionary<string, (bool, int)> uvs;
public Dictionary<string, int> texs; public Dictionary<int, string> texs;
} }
} }
} }

View File

@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> <TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<Version>1.00.00</Version> <Version>1.36.00</Version>
<AssemblyVersion>1.00.00</AssemblyVersion> <AssemblyVersion>1.36.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion> <FileVersion>1.36.00</FileVersion>
<Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright> <Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
</PropertyGroup> </PropertyGroup>

View File

@@ -361,12 +361,12 @@ namespace AssetStudio
Container = "" Container = ""
}; };
var exportable = true; var exportable = false;
try try
{ {
switch (objectReader.type) switch (objectReader.type)
{ {
case ClassIDType.AssetBundle: case ClassIDType.AssetBundle when ClassIDType.AssetBundle.CanParse():
var assetBundle = new AssetBundle(objectReader); var assetBundle = new AssetBundle(objectReader);
foreach (var m_Container in assetBundle.m_Container) foreach (var m_Container in assetBundle.m_Container)
{ {
@@ -378,33 +378,38 @@ namespace AssetStudio
containers.Add((assetBundle.m_PreloadTable[k], m_Container.Key)); containers.Add((assetBundle.m_PreloadTable[k], m_Container.Key));
} }
} }
obj = null; obj = null;
asset.Name = assetBundle.m_Name; asset.Name = assetBundle.m_Name;
exportable = !Minimal; exportable = ClassIDType.AssetBundle.CanExport();
break; break;
case ClassIDType.GameObject: case ClassIDType.GameObject when ClassIDType.GameObject.CanParse():
var gameObject = new GameObject(objectReader); var gameObject = new GameObject(objectReader);
obj = gameObject; obj = gameObject;
asset.Name = gameObject.m_Name; asset.Name = gameObject.m_Name;
exportable = !Minimal; exportable = ClassIDType.GameObject.CanExport();
break; break;
case ClassIDType.Shader: case ClassIDType.Shader when ClassIDType.Shader.CanParse():
asset.Name = objectReader.ReadAlignedString(); asset.Name = objectReader.ReadAlignedString();
if (string.IsNullOrEmpty(asset.Name)) if (string.IsNullOrEmpty(asset.Name))
{ {
var m_parsedForm = new SerializedShader(objectReader); var m_parsedForm = new SerializedShader(objectReader);
asset.Name = m_parsedForm.m_Name; asset.Name = m_parsedForm.m_Name;
} }
exportable = ClassIDType.Shader.CanExport();
break; break;
case ClassIDType.Animator: case ClassIDType.Animator when ClassIDType.Animator.CanParse():
var component = new PPtr<Object>(objectReader); var component = new PPtr<Object>(objectReader);
animators.Add((component, asset)); animators.Add((component, asset));
exportable = ClassIDType.Animator.CanExport();
break; break;
case ClassIDType.MiHoYoBinData: case ClassIDType.MiHoYoBinData when ClassIDType.MiHoYoBinData.CanParse():
var MiHoYoBinData = new MiHoYoBinData(objectReader); var MiHoYoBinData = new MiHoYoBinData(objectReader);
obj = MiHoYoBinData; obj = MiHoYoBinData;
exportable = ClassIDType.MiHoYoBinData.CanExport();
break; break;
case ClassIDType.IndexObject: case ClassIDType.IndexObject when ClassIDType.IndexObject.CanParse():
var indexObject = new IndexObject(objectReader); var indexObject = new IndexObject(objectReader);
obj = null; obj = null;
foreach (var index in indexObject.AssetMap) foreach (var index in indexObject.AssetMap)
@@ -412,19 +417,20 @@ namespace AssetStudio
mihoyoBinDataNames.Add((index.Value.Object, index.Key)); mihoyoBinDataNames.Add((index.Value.Object, index.Key));
} }
asset.Name = "IndexObject"; asset.Name = "IndexObject";
exportable = !Minimal; exportable = ClassIDType.IndexObject.CanExport();
break; break;
case ClassIDType.Font: case ClassIDType.Font when ClassIDType.Font.CanExport():
case ClassIDType.Material: case ClassIDType.Material when ClassIDType.Material.CanExport():
case ClassIDType.Texture: case ClassIDType.Texture when ClassIDType.Texture.CanExport():
case ClassIDType.Mesh: case ClassIDType.Mesh when ClassIDType.Mesh.CanExport():
case ClassIDType.Sprite: case ClassIDType.Sprite when ClassIDType.Sprite.CanExport():
case ClassIDType.TextAsset: case ClassIDType.TextAsset when ClassIDType.TextAsset.CanExport():
case ClassIDType.Texture2D: case ClassIDType.Texture2D when ClassIDType.Texture2D.CanExport():
case ClassIDType.VideoClip: case ClassIDType.VideoClip when ClassIDType.VideoClip.CanExport():
case ClassIDType.AudioClip: case ClassIDType.AudioClip when ClassIDType.AudioClip.CanExport():
case ClassIDType.AnimationClip: case ClassIDType.AnimationClip when ClassIDType.AnimationClip.CanExport():
asset.Name = objectReader.ReadAlignedString(); asset.Name = objectReader.ReadAlignedString();
exportable = true;
break; break;
default: default:
asset.Name = objectReader.type.ToString(); asset.Name = objectReader.type.ToString();

View File

@@ -646,36 +646,36 @@ namespace AssetStudio
{ {
Object obj = objectReader.type switch Object obj = objectReader.type switch
{ {
ClassIDType.Animation => new Animation(objectReader), ClassIDType.Animation when ClassIDType.Animation.CanParse() => new Animation(objectReader),
ClassIDType.AnimationClip => new AnimationClip(objectReader), ClassIDType.AnimationClip when ClassIDType.AnimationClip.CanParse() => new AnimationClip(objectReader),
ClassIDType.Animator => new Animator(objectReader), ClassIDType.Animator when ClassIDType.Animator.CanParse() => new Animator(objectReader),
ClassIDType.AnimatorController => new AnimatorController(objectReader), ClassIDType.AnimatorController when ClassIDType.AnimatorController.CanParse() => new AnimatorController(objectReader),
ClassIDType.AnimatorOverrideController => new AnimatorOverrideController(objectReader), ClassIDType.AnimatorOverrideController when ClassIDType.AnimatorOverrideController.CanParse() => new AnimatorOverrideController(objectReader),
ClassIDType.AssetBundle => new AssetBundle(objectReader), ClassIDType.AssetBundle when ClassIDType.AssetBundle.CanParse() => new AssetBundle(objectReader),
ClassIDType.AudioClip => new AudioClip(objectReader), ClassIDType.AudioClip when ClassIDType.AudioClip.CanParse() => new AudioClip(objectReader),
ClassIDType.Avatar => new Avatar(objectReader), ClassIDType.Avatar when ClassIDType.Avatar.CanParse() => new Avatar(objectReader),
ClassIDType.Font => new Font(objectReader), ClassIDType.Font when ClassIDType.Font.CanParse() => new Font(objectReader),
ClassIDType.GameObject => new GameObject(objectReader), ClassIDType.GameObject when ClassIDType.GameObject.CanParse() => new GameObject(objectReader),
ClassIDType.IndexObject => new IndexObject(objectReader), ClassIDType.IndexObject when ClassIDType.IndexObject.CanParse() => new IndexObject(objectReader),
ClassIDType.Material => new Material(objectReader), ClassIDType.Material when ClassIDType.Material.CanParse() => new Material(objectReader),
ClassIDType.Mesh => new Mesh(objectReader), ClassIDType.Mesh when ClassIDType.Mesh.CanParse() => new Mesh(objectReader),
ClassIDType.MeshFilter => new MeshFilter(objectReader), ClassIDType.MeshFilter when ClassIDType.MeshFilter.CanParse() => new MeshFilter(objectReader),
ClassIDType.MeshRenderer => new MeshRenderer(objectReader), ClassIDType.MeshRenderer when ClassIDType.MeshRenderer.CanParse() => new MeshRenderer(objectReader),
ClassIDType.MiHoYoBinData => new MiHoYoBinData(objectReader), ClassIDType.MiHoYoBinData when ClassIDType.MiHoYoBinData.CanParse() => new MiHoYoBinData(objectReader),
ClassIDType.MonoBehaviour => new MonoBehaviour(objectReader), ClassIDType.MonoBehaviour when ClassIDType.MonoBehaviour.CanParse() => new MonoBehaviour(objectReader),
ClassIDType.MonoScript => new MonoScript(objectReader), ClassIDType.MonoScript when ClassIDType.MonoScript.CanParse() => new MonoScript(objectReader),
ClassIDType.MovieTexture => new MovieTexture(objectReader), ClassIDType.MovieTexture when ClassIDType.MovieTexture.CanParse() => new MovieTexture(objectReader),
ClassIDType.PlayerSettings => new PlayerSettings(objectReader), ClassIDType.PlayerSettings when ClassIDType.PlayerSettings.CanParse() => new PlayerSettings(objectReader),
ClassIDType.RectTransform => new RectTransform(objectReader), ClassIDType.RectTransform when ClassIDType.RectTransform.CanParse() => new RectTransform(objectReader),
ClassIDType.Shader => new Shader(objectReader), ClassIDType.Shader when ClassIDType.Shader.CanParse() => new Shader(objectReader),
ClassIDType.SkinnedMeshRenderer => new SkinnedMeshRenderer(objectReader), ClassIDType.SkinnedMeshRenderer when ClassIDType.SkinnedMeshRenderer.CanParse() => new SkinnedMeshRenderer(objectReader),
ClassIDType.Sprite => new Sprite(objectReader), ClassIDType.Sprite when ClassIDType.Sprite.CanParse() => new Sprite(objectReader),
ClassIDType.SpriteAtlas => new SpriteAtlas(objectReader), ClassIDType.SpriteAtlas when ClassIDType.SpriteAtlas.CanParse() => new SpriteAtlas(objectReader),
ClassIDType.TextAsset => new TextAsset(objectReader), ClassIDType.TextAsset when ClassIDType.TextAsset.CanParse() => new TextAsset(objectReader),
ClassIDType.Texture2D => new Texture2D(objectReader), ClassIDType.Texture2D when ClassIDType.Texture2D.CanParse() => new Texture2D(objectReader),
ClassIDType.Transform => new Transform(objectReader), ClassIDType.Transform when ClassIDType.Transform.CanParse() => new Transform(objectReader),
ClassIDType.VideoClip => new VideoClip(objectReader), ClassIDType.VideoClip when ClassIDType.VideoClip.CanParse() => new VideoClip(objectReader),
ClassIDType.ResourceManager => new ResourceManager(objectReader), ClassIDType.ResourceManager when ClassIDType.ResourceManager.CanParse() => new ResourceManager(objectReader),
_ => new Object(objectReader), _ => new Object(objectReader),
}; };
assetsFile.AddObject(obj); assetsFile.AddObject(obj);

46
AssetStudio/TypeFlags.cs Normal file
View File

@@ -0,0 +1,46 @@
using System.Collections.Generic;
namespace AssetStudio;
public static class TypeFlags
{
private static Dictionary<ClassIDType, (bool, bool)> Types;
public static void SetTypes(Dictionary<ClassIDType, (bool, bool)> types)
{
Types = types;
}
public static void SetType(ClassIDType type, bool parse, bool export)
{
Types ??= new Dictionary<ClassIDType, (bool, bool)>();
Types[type] = (parse, export);
}
public static bool CanParse(this ClassIDType type)
{
if (Types == null)
{
return true;
}
else if (Types.TryGetValue(type, out var param))
{
return param.Item1;
}
return false;
}
public static bool CanExport(this ClassIDType type)
{
if (Types == null)
{
return true;
}
else if (Types.TryGetValue(type, out var param))
{
return param.Item2;
}
return false;
}
}