mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-15 19:28:48 -05:00
[GUI] Add option to specify parsing mode of Tuanjie meshes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AssetStudio.CustomOptions;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -744,13 +745,16 @@ namespace AssetStudio
|
||||
var m_KeepIndices = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
if (version.IsTuanjie)
|
||||
var tuanjieParsingMode = reader.assetsFile.assetsManager.Options.MeshOptions.TuanjieMeshParsingMode;
|
||||
var useSharedClusterData = tuanjieParsingMode == ImportOptions.CustomMeshOptions.MeshParsingMode.Tuanjie
|
||||
|| (tuanjieParsingMode == ImportOptions.CustomMeshOptions.MeshParsingMode.Auto && reader.version < (2022, 3, 61, 2));
|
||||
if (version.IsTuanjie && useSharedClusterData)
|
||||
{
|
||||
if (version < (2022, 3, 48) || (version == (2022, 3, 48) && version.Build < 3)) //2022.3.48t3(1.4.0) down
|
||||
if (version < (2022, 3, 48, 3)) //2022.3.48t3(1.4.0) down
|
||||
{
|
||||
_ = new SharedClusterData(reader, rev: 1);
|
||||
}
|
||||
else if (version < (2022, 3, 61) || (version == (2022, 3, 61) && version.Build < 2)) //2022.3.48t3(1.4.0) - 2022.3.61t1(1.6.0)
|
||||
else if (version < (2022, 3, 61, 2)) //2022.3.48t3(1.4.0) - 2022.3.61t1(1.6.0)
|
||||
{
|
||||
_ = new SharedClusterData(reader, rev: 2);
|
||||
}
|
||||
|
||||
@@ -34,18 +34,6 @@
|
||||
}
|
||||
|
||||
public CustomBundleOptions() { }
|
||||
|
||||
private static T SetOption<T>(string option, T value, T curValue)
|
||||
{
|
||||
if (value.Equals(curValue))
|
||||
return curValue;
|
||||
|
||||
var val = string.IsNullOrEmpty(value.ToString())
|
||||
? "None"
|
||||
: value.ToString();
|
||||
Logger.Info($"- {option}: {val}");
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace AssetStudio.CustomOptions
|
||||
{
|
||||
public partial class ImportOptions
|
||||
{
|
||||
public sealed class CustomMeshOptions
|
||||
{
|
||||
public enum MeshParsingMode
|
||||
{
|
||||
Auto,
|
||||
Tuanjie,
|
||||
Unity,
|
||||
}
|
||||
|
||||
private MeshParsingMode _tuanjieMeshParsingMode;
|
||||
|
||||
public MeshParsingMode TuanjieMeshParsingMode
|
||||
{
|
||||
get => _tuanjieMeshParsingMode;
|
||||
set => _tuanjieMeshParsingMode = SetOption(nameof(TuanjieMeshParsingMode), value, _tuanjieMeshParsingMode);
|
||||
}
|
||||
|
||||
public CustomMeshOptions() { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ namespace AssetStudio.CustomOptions
|
||||
public event EventHandler UnityVersionChanged;
|
||||
|
||||
public CustomBundleOptions BundleOptions { get; set; }
|
||||
public CustomMeshOptions MeshOptions { get; set; }
|
||||
public UnityVersion CustomUnityVersion { get => _customUnityVer; set => SetUnityVersion(value); }
|
||||
|
||||
static ImportOptions()
|
||||
@@ -31,6 +32,7 @@ namespace AssetStudio.CustomOptions
|
||||
public ImportOptions()
|
||||
{
|
||||
BundleOptions = new CustomBundleOptions();
|
||||
MeshOptions = new CustomMeshOptions();
|
||||
CustomUnityVersion = null;
|
||||
}
|
||||
|
||||
@@ -94,5 +96,17 @@ namespace AssetStudio.CustomOptions
|
||||
|
||||
Logger.Info($"- Specified Unity version: {_customUnityVer}");
|
||||
}
|
||||
|
||||
private static T SetOption<T>(string option, T value, T curValue)
|
||||
{
|
||||
if (value.Equals(curValue))
|
||||
return curValue;
|
||||
|
||||
var val = string.IsNullOrEmpty(value.ToString())
|
||||
? "None"
|
||||
: value.ToString();
|
||||
Logger.Info($"- {option}: {val}");
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user