Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
v1.36.00
Browse files Browse the repository at this point in the history
  • Loading branch information
Razmoth committed Jan 27, 2024
1 parent 8735977 commit e19d7b9
Show file tree
Hide file tree
Showing 26 changed files with 484 additions and 348 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,38 @@ jobs:
- name: 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
run: msbuild /t:AssetStudio_GUI:publish /p:Configuration=Release /p:TargetFramework=net7.0-windows /p:SelfContained=false /verbosity:minimal

- name: Build .Net6 CLI
run: msbuild /t:AssetStudio_CLI:publish /p:Configuration=Release /p:TargetFramework=net6.0-windows /p:SelfContained=false /verbosity:minimal
- name: Build .Net8
run: msbuild /t:AssetStudio_GUI:publish /p:Configuration=Release /p:TargetFramework=net8.0-windows /p:SelfContained=false /verbosity:minimal

- name: Build .Net7 CLI
run: msbuild /t:AssetStudio_CLI:publish /p:Configuration=Release /p:TargetFramework=net7.0-windows /p:SelfContained=false /verbosity:minimal

- name: Upload .Net6 Artifact
uses: actions/upload-artifact@v3
with:
name: net6.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net6.0-windows/publish
- name: Build .Net8 CLI
run: msbuild /t:AssetStudio_CLI:publish /p:Configuration=Release /p:TargetFramework=net8.0-windows /p:SelfContained=false /verbosity:minimal

- name: Upload .Net7 Artifact
uses: actions/upload-artifact@v3
with:
name: net7.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net7.0-windows/publish

- name: Upload .Net6 CLI Artifact
- name: Upload .Net8 Artifact
uses: actions/upload-artifact@v3
with:
name: net6.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net6.0-windows/publish
name: net8.0-${{ github.sha }}
path: AssetStudio.GUI/bin/Release/net8.0-windows/publish

- name: Upload .Net7 CLI Artifact
uses: actions/upload-artifact@v3
with:
name: net7.0-${{ github.sha }}
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
3 changes: 2 additions & 1 deletion AssetStudio.CLI/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<add key="minimalAssetMap" value="True" />
<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="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>
</configuration>
8 changes: 4 additions & 4 deletions AssetStudio.CLI/AssetStudio.CLI.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0-windows;net7.0-windows</TargetFrameworks>
<TargetFrameworks>net7.0-windows;net8.0-windows</TargetFrameworks>
<ApplicationIcon>Resources\as.ico</ApplicationIcon>
<Version>1.00.00</Version>
<AssemblyVersion>1.00.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion>
<Version>1.36.00</Version>
<AssemblyVersion>1.36.00</AssemblyVersion>
<FileVersion>1.36.00</FileVersion>
<Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright>
<BaseOutputPath>..\AssetStudio.GUI\bin</BaseOutputPath>
</PropertyGroup>
Expand Down
5 changes: 0 additions & 5 deletions AssetStudio.CLI/Components/CommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public static RootCommand RegisterOptions()
optionsBinder.UnityVersion,
optionsBinder.GroupAssetsType,
optionsBinder.AssetExportType,
optionsBinder.Model,
optionsBinder.Key,
optionsBinder.AIFile,
optionsBinder.DummyDllFolder,
Expand Down Expand Up @@ -61,7 +60,6 @@ public class Options
public string UnityVersion { get; set; }
public AssetGroupOption GroupAssetsType { get; set; }
public ExportType AssetExportType { get; set; }
public bool Model { get; set; }
public byte Key { get; set; }
public FileInfo AIFile { get; set; }
public DirectoryInfo DummyDllFolder { get; set; }
Expand All @@ -84,7 +82,6 @@ public class OptionsBinder : BinderBase<Options>
public readonly Option<string> UnityVersion;
public readonly Option<AssetGroupOption> GroupAssetsType;
public readonly Option<ExportType> AssetExportType;
public readonly Option<bool> Model;
public readonly Option<byte> Key;
public readonly Option<FileInfo> AIFile;
public readonly Option<DirectoryInfo> DummyDllFolder;
Expand All @@ -106,7 +103,6 @@ public OptionsBinder()
UnityVersion = new Option<string>("--unity_version", "Specify Unity version.");
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.");
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();
DummyDllFolder = new Option<DirectoryInfo>("--dummy_dlls", "Specify DummyDll path.").LegalFilePathsOnly();
Input = new Argument<FileInfo>("input_path", "Input file/folder.").LegalFilePathsOnly();
Expand Down Expand Up @@ -200,7 +196,6 @@ protected override Options GetBoundValue(BindingContext bindingContext) =>
UnityVersion = bindingContext.ParseResult.GetValueForOption(UnityVersion),
GroupAssetsType = bindingContext.ParseResult.GetValueForOption(GroupAssetsType),
AssetExportType = bindingContext.ParseResult.GetValueForOption(AssetExportType),
Model = bindingContext.ParseResult.GetValueForOption(Model),
Key = bindingContext.ParseResult.GetValueForOption(Key),
AIFile = bindingContext.ParseResult.GetValueForOption(AIFile),
DummyDllFolder = bindingContext.ParseResult.GetValueForOption(DummyDllFolder),
Expand Down
4 changes: 2 additions & 2 deletions AssetStudio.CLI/Exporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public static bool ExportAnimator(AssetItem item, string exportPath, List<AssetI
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),
texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
};
var convert = animationList != null
? new ModelConverter(m_Animator, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
Expand All @@ -392,7 +392,7 @@ public static bool ExportGameObject(GameObject gameObject, string exportPath, Li
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),
texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
};
var convert = animationList != null
? new ModelConverter(gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
Expand Down
27 changes: 26 additions & 1 deletion AssetStudio.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Threading;
using AssetStudio.CLI.Properties;
using Newtonsoft.Json;
using static AssetStudio.CLI.Studio;

namespace AssetStudio.CLI
Expand Down Expand Up @@ -44,10 +45,34 @@ public static void Run(Options o)
AssetsHelper.Minimal = Settings.Default.minimalAssetMap;
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.Game = game;
assetsManager.SpecifyUnityVersion = o.UnityVersion;
ModelOnly = o.Model;
o.Output.Create();

if (o.Key != default)
Expand Down
1 change: 1 addition & 0 deletions AssetStudio.CLI/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class Settings
public bool enableFileLogging => AppSettings.Get("enableFileLogging", false);
public bool minimalAssetMap => AppSettings.Get("minimalAssetMap", true);
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 uvs => AppSettings.Get("uvs", string.Empty);

Expand Down
41 changes: 23 additions & 18 deletions AssetStudio.CLI/Studio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public enum MapOpType
internal static class Studio
{
public static Game Game;
public static bool ModelOnly = false;
public static bool SkipContainer = false;
public static AssetsManager assetsManager = new AssetsManager() { ResolveDependencies = false };
public static AssemblyLoader assemblyLoader = new AssemblyLoader();
Expand Down Expand Up @@ -286,25 +285,25 @@ public static void ProcessAssetData(Object asset, ClassIDType[] typeFilters, Reg
switch (asset)
{
case GameObject m_GameObject:
exportable = ModelOnly && m_GameObject.HasModel();
exportable = ClassIDType.GameObject.CanExport() && m_GameObject.HasModel();
break;
case Texture2D m_Texture2D:
if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path))
assetItem.FullSize = asset.byteSize + m_Texture2D.m_StreamData.size;
exportable = !ModelOnly;
exportable = ClassIDType.Texture2D.CanExport();
break;
case AudioClip m_AudioClip:
if (!string.IsNullOrEmpty(m_AudioClip.m_Source))
assetItem.FullSize = asset.byteSize + m_AudioClip.m_Size;
exportable = !ModelOnly;
exportable = ClassIDType.AudioClip.CanExport();
break;
case VideoClip m_VideoClip:
if (!string.IsNullOrEmpty(m_VideoClip.m_OriginalPath))
assetItem.FullSize = asset.byteSize + (long)m_VideoClip.m_ExternalResources.m_Size;
exportable = !ModelOnly;
assetItem.FullSize = asset.byteSize + m_VideoClip.m_ExternalResources.m_Size;
exportable = ClassIDType.VideoClip.CanExport();
break;
case MonoBehaviour m_MonoBehaviour:
exportable = !ModelOnly && assemblyLoader.Loaded;
exportable = ClassIDType.MonoBehaviour.CanExport();
break;
case AssetBundle m_AssetBundle:
foreach (var m_Container in m_AssetBundle.m_Container)
Expand All @@ -317,30 +316,36 @@ public static void ProcessAssetData(Object asset, ClassIDType[] typeFilters, Reg
containers.Add((m_AssetBundle.m_PreloadTable[k], m_Container.Key));
}
}

exportable = ClassIDType.AssetBundle.CanExport();
break;
case IndexObject m_IndexObject:
foreach (var index in m_IndexObject.AssetMap)
{
mihoyoBinDataNames.Add((index.Value.Object, index.Key));
}

exportable = ClassIDType.IndexObject.CanExport();
break;
case ResourceManager m_ResourceManager:
foreach (var m_Container in m_ResourceManager.m_Container)
{
containers.Add((m_Container.Value, m_Container.Key));
}

exportable = ClassIDType.GameObject.CanExport();
break;
case Mesh _:
case TextAsset _:
case AnimationClip _:
case Font _:
case MovieTexture _:
case Sprite _:
case Material _:
case MiHoYoBinData _:
case Shader _:
case Animator _:
exportable = !ModelOnly;
case Mesh _ when ClassIDType.Mesh.CanExport():
case TextAsset _ when ClassIDType.TextAsset.CanExport():
case AnimationClip _ when ClassIDType.Font.CanExport():
case Font _ when ClassIDType.GameObject.CanExport():
case MovieTexture _ when ClassIDType.MovieTexture.CanExport():
case Sprite _ when ClassIDType.Sprite.CanExport():
case Material _ when ClassIDType.Material.CanExport():
case MiHoYoBinData _ when ClassIDType.MiHoYoBinData.CanExport():
case Shader _ when ClassIDType.Shader.CanExport():
case Animator _ when ClassIDType.Animator.CanExport():
exportable = true;
break;
}
if (assetItem.Text == "")
Expand Down
8 changes: 4 additions & 4 deletions AssetStudio.FBXWrapper/AssetStudio.FBXWrapper.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>1.00.00</Version>
<AssemblyVersion>1.00.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion>
<Version>1.36.00</Version>
<AssemblyVersion>1.36.00</AssemblyVersion>
<FileVersion>1.36.00</FileVersion>
<Copyright>Copyright © Perfare 2018-2022; Copyright © hozuki 2020</Copyright>
<DebugType>embedded</DebugType>
</PropertyGroup>
Expand Down
5 changes: 4 additions & 1 deletion AssetStudio.GUI/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@
<value>True</value>
</setting>
<setting name="texs" serializeAs="String">
<value>{}</value>
<value>{"0": "", "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": ""}</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="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">
<value>False</value>
</setting>
Expand Down
8 changes: 4 additions & 4 deletions AssetStudio.GUI/AssetStudio.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

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

0 comments on commit e19d7b9

Please sign in to comment.