Some other fixes
This commit is contained in:
@@ -15,7 +15,7 @@ namespace AssetStudio
|
||||
{
|
||||
public class AssetsManager
|
||||
{
|
||||
public bool LoadingViaTypeTreeEnabled = true;
|
||||
public bool LoadViaTypeTree = true;
|
||||
public ImportOptions Options = new ImportOptions();
|
||||
public readonly List<Action<OptionsFile>> OptionLoaders = new List<Action<OptionsFile>>();
|
||||
public readonly List<SerializedFile> AssetsFileList = new List<SerializedFile>();
|
||||
@@ -154,6 +154,8 @@ namespace AssetStudio
|
||||
importFilesHash.Clear();
|
||||
noexistFiles.Clear();
|
||||
assetsFileListHash.Clear();
|
||||
if (AssetsFileList.Count == 0)
|
||||
return;
|
||||
|
||||
ReadAssets();
|
||||
ProcessAssets();
|
||||
@@ -188,6 +190,9 @@ namespace AssetStudio
|
||||
case FileType.ZipFile:
|
||||
LoadZipFile(reader);
|
||||
break;
|
||||
case FileType.ResourceFile when !fromZip:
|
||||
reader.Dispose();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -277,7 +282,7 @@ namespace AssetStudio
|
||||
catch (NotSupportedException e)
|
||||
{
|
||||
Logger.Error(e.Message);
|
||||
resourceFileReaders.TryAdd(reader.FileName, reader);
|
||||
reader.Dispose();
|
||||
return false;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -648,7 +653,7 @@ namespace AssetStudio
|
||||
obj = new Animation(objectReader);
|
||||
break;
|
||||
case ClassIDType.AnimationClip:
|
||||
obj = objectReader.serializedType?.m_Type != null && LoadingViaTypeTreeEnabled
|
||||
obj = objectReader.serializedType?.m_Type != null && LoadViaTypeTree
|
||||
? new AnimationClip(objectReader, TypeTreeHelper.ReadTypeByteArray(objectReader.serializedType.m_Type, objectReader), jsonOptions, objectInfo)
|
||||
: new AnimationClip(objectReader);
|
||||
break;
|
||||
@@ -680,7 +685,7 @@ namespace AssetStudio
|
||||
obj = new GameObject(objectReader);
|
||||
break;
|
||||
case ClassIDType.Material:
|
||||
obj = objectReader.serializedType?.m_Type != null && LoadingViaTypeTreeEnabled
|
||||
obj = objectReader.serializedType?.m_Type != null && LoadViaTypeTree
|
||||
? new Material(objectReader, TypeTreeHelper.ReadTypeByteArray(objectReader.serializedType.m_Type, objectReader), jsonOptions)
|
||||
: new Material(objectReader);
|
||||
break;
|
||||
@@ -728,12 +733,12 @@ namespace AssetStudio
|
||||
obj = new TextAsset(objectReader);
|
||||
break;
|
||||
case ClassIDType.Texture2D:
|
||||
obj = objectReader.serializedType?.m_Type != null && LoadingViaTypeTreeEnabled
|
||||
obj = objectReader.serializedType?.m_Type != null && LoadViaTypeTree
|
||||
? new Texture2D(objectReader, TypeTreeHelper.ReadTypeByteArray(objectReader.serializedType.m_Type, objectReader), jsonOptions)
|
||||
: new Texture2D(objectReader);
|
||||
break;
|
||||
case ClassIDType.Texture2DArray:
|
||||
obj = objectReader.serializedType?.m_Type != null && LoadingViaTypeTreeEnabled
|
||||
obj = objectReader.serializedType?.m_Type != null && LoadViaTypeTree
|
||||
? new Texture2DArray(objectReader, TypeTreeHelper.ReadTypeByteArray(objectReader.serializedType.m_Type, objectReader), jsonOptions)
|
||||
: new Texture2DArray(objectReader);
|
||||
break;
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace AssetStudio
|
||||
{
|
||||
if (typeDict != null)
|
||||
{
|
||||
return JsonSerializer.SerializeToDocument(typeDict);
|
||||
return JsonSerializer.SerializeToDocument(typeDict, jsonOptions);
|
||||
}
|
||||
return JsonSerializer.SerializeToDocument(this, GetType(), jsonOptions);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace AssetStudio
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Container { get; set; }
|
||||
public bool IsRoot { get; set; }
|
||||
public MonoBehaviour CubismModelMono { get; set; }
|
||||
public MonoBehaviour PhysicsController { get; set; }
|
||||
public MonoBehaviour FadeController { get; set; }
|
||||
@@ -21,7 +20,6 @@ namespace AssetStudio
|
||||
public CubismModel(GameObject m_GameObject)
|
||||
{
|
||||
Name = m_GameObject.m_Name;
|
||||
IsRoot = m_GameObject.m_Transform.m_Father.IsNull;
|
||||
ModelGameObject = m_GameObject;
|
||||
RenderTextureList = new List<MonoBehaviour>();
|
||||
ParamDisplayInfoList = new List<MonoBehaviour>();
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace AssetStudio
|
||||
{
|
||||
var stringData = reader.ReadBytes(length);
|
||||
var result = Encoding.UTF8.GetString(stringData);
|
||||
reader.AlignStream(4);
|
||||
reader.AlignStream();
|
||||
return result;
|
||||
}
|
||||
return "";
|
||||
|
||||
@@ -302,10 +302,11 @@ namespace AssetStudio
|
||||
case "TypelessData":
|
||||
{
|
||||
var size = reader.ReadInt32();
|
||||
var offset = size > 0 ? reader.BaseStream.Position : 0;
|
||||
var dic = new OrderedDictionary
|
||||
{
|
||||
{ "Offset", reader.BaseStream.Position },
|
||||
{ "Size", size }
|
||||
{"Offset", offset},
|
||||
{"Size", size}
|
||||
};
|
||||
value = dic;
|
||||
reader.BaseStream.Position += size;
|
||||
|
||||
@@ -107,19 +107,18 @@ namespace AssetStudioCLI
|
||||
{
|
||||
var m_TextAsset = (TextAsset)item.Asset;
|
||||
var extension = ".txt";
|
||||
var assetExtension = Path.GetExtension(m_TextAsset.m_Name);
|
||||
if (!CLIOptions.f_notRestoreExtensionName.Value)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(assetExtension))
|
||||
if (Path.HasExtension(m_TextAsset.m_Name))
|
||||
{
|
||||
extension = "";
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(item.Container))
|
||||
else
|
||||
{
|
||||
var ext = Path.GetExtension(item.Container);
|
||||
if (!string.IsNullOrEmpty(item.Container))
|
||||
var extFromContainer = Path.GetExtension(item.Container);
|
||||
if (!string.IsNullOrEmpty(extFromContainer))
|
||||
{
|
||||
extension = ext;
|
||||
extension = extFromContainer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace AssetStudioCLI.Options
|
||||
public static Option<FilenameFormat> o_filenameFormat;
|
||||
public static Option<string> o_outputFolder;
|
||||
public static Option<bool> f_overwriteExisting;
|
||||
public static Option<bool> o_displayHelp;
|
||||
public static Option<bool> f_displayHelp;
|
||||
//logger
|
||||
public static Option<LoggerEvent> o_logLevel;
|
||||
public static Option<LogOutputMode> o_logOutput;
|
||||
@@ -264,13 +264,14 @@ namespace AssetStudioCLI.Options
|
||||
optionHelpGroup: HelpGroups.General,
|
||||
isFlag: true
|
||||
);
|
||||
o_displayHelp = new GroupedOption<bool>
|
||||
f_displayHelp = new GroupedOption<bool>
|
||||
(
|
||||
optionDefaultValue: false,
|
||||
optionName: "-h, --help",
|
||||
optionDescription: "Display help and exit",
|
||||
optionExample: "",
|
||||
optionHelpGroup: HelpGroups.General
|
||||
optionHelpGroup: HelpGroups.General,
|
||||
isFlag: true
|
||||
);
|
||||
#endregion
|
||||
|
||||
@@ -533,7 +534,7 @@ namespace AssetStudioCLI.Options
|
||||
(
|
||||
optionDefaultValue: false,
|
||||
optionName: "--decompress-to-disk",
|
||||
optionDescription: "(Flag) If not specified, only bundles larger than 2GB will be decompressed to disk\ninstead of memory\n",
|
||||
optionDescription: "(Flag) If not specified, only bundles larger than 2GB will be decompressed to disk\ninstead of RAM\n",
|
||||
optionExample: "",
|
||||
optionHelpGroup: HelpGroups.Advanced,
|
||||
isFlag: true
|
||||
@@ -577,7 +578,7 @@ namespace AssetStudioCLI.Options
|
||||
|
||||
if (args.Length == 0 || args.Any(x => x.ToLower() == "-h" || x.ToLower() == "--help" || x.ToLower() == "-?"))
|
||||
{
|
||||
o_displayHelp.Value = true;
|
||||
f_displayHelp.Value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1030,6 +1031,7 @@ namespace AssetStudioCLI.Options
|
||||
case "monobehaviour":
|
||||
o_l2dMotionMode.Value = CubismLive2DExtractor.Live2DMotionMode.MonoBehaviour;
|
||||
break;
|
||||
case "clip":
|
||||
case "animationclip":
|
||||
case "animationclipv2":
|
||||
o_l2dMotionMode.Value = CubismLive2DExtractor.Live2DMotionMode.AnimationClipV2;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace AssetStudioCLI
|
||||
{
|
||||
CLIRun();
|
||||
}
|
||||
else if (CLIOptions.o_displayHelp.Value)
|
||||
else if (CLIOptions.f_displayHelp.Value)
|
||||
{
|
||||
CLIOptions.ShowHelp();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace AssetStudioCLI
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
|
||||
Progress.Default = new Progress<int>(ShowCurProgressValue);
|
||||
assetsManager.LoadingViaTypeTreeEnabled = !CLIOptions.f_avoidLoadingViaTypetree.Value;
|
||||
assetsManager.LoadViaTypeTree = !CLIOptions.f_avoidLoadingViaTypetree.Value;
|
||||
assetsManager.Options.CustomUnityVersion = CLIOptions.o_unityVersion.Value;
|
||||
assetsManager.Options.BundleOptions.CustomBlockInfoCompression = CLIOptions.o_bundleBlockInfoCompression.Value;
|
||||
assetsManager.Options.BundleOptions.CustomBlockCompression = CLIOptions.o_bundleBlockCompression.Value;
|
||||
|
||||
3
AssetStudioGUI/AssetStudioGUIForm.Designer.cs
generated
3
AssetStudioGUI/AssetStudioGUIForm.Designer.cs
generated
@@ -395,6 +395,7 @@
|
||||
this.specifyUnityVersionTextBox.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.specifyUnityVersionTextBox.Name = "specifyUnityVersionTextBox";
|
||||
this.specifyUnityVersionTextBox.Size = new System.Drawing.Size(100, 23);
|
||||
this.specifyUnityVersionTextBox.ToolTipText = "Specify full Unity version, including letters at the end\r\nExample: 2017.4.39f1";
|
||||
//
|
||||
// bundleDecompressionToolStripMenuItem
|
||||
//
|
||||
@@ -411,7 +412,7 @@
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.ShowShortcutKeys = false;
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.Text = "Always decompress to disk";
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.ToolTipText = "If not selected, any bundles less than 2GB will be decompressed to memory";
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.ToolTipText = "If not selected, any bundles less than 2GB will be decompressed to RAM";
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.Click += new System.EventHandler(this.alwaysDecompressToDiskToolStripMenuItem_Click);
|
||||
//
|
||||
// blockInfoCompressionTypeToolStripMenuItem
|
||||
|
||||
@@ -317,9 +317,9 @@ namespace AssetStudioGUI
|
||||
allToolStripMenuItem.Checked = true;
|
||||
var log = $"Finished loading {assetsManager.AssetsFileList.Count} file(s) with {assetListView.Items.Count} exportable assets";
|
||||
var unityVer = assetsManager.AssetsFileList[0].version;
|
||||
var m_ObjectsCount = unityVer > 2020 ?
|
||||
assetsManager.AssetsFileList.Sum(x => x.m_Objects.LongCount(y => y.classID != (int)ClassIDType.Shader)) :
|
||||
assetsManager.AssetsFileList.Sum(x => x.m_Objects.Count);
|
||||
var m_ObjectsCount = unityVer > 2020
|
||||
? assetsManager.AssetsFileList.Sum(x => x.m_Objects.LongCount(y => y.classID != (int)ClassIDType.Shader))
|
||||
: assetsManager.AssetsFileList.Sum(x => x.m_Objects.Count);
|
||||
var objectsCount = assetsManager.AssetsFileList.Sum(x => x.Objects.Count);
|
||||
if (m_ObjectsCount != objectsCount)
|
||||
{
|
||||
@@ -483,7 +483,6 @@ namespace AssetStudioGUI
|
||||
{
|
||||
case ClassIDType.Texture2D:
|
||||
case ClassIDType.Sprite:
|
||||
{
|
||||
if (enablePreview.Checked && imageTexture != null)
|
||||
{
|
||||
previewPanel.Image = imageTexture.Bitmap;
|
||||
@@ -493,7 +492,6 @@ namespace AssetStudioGUI
|
||||
previewPanel.Image = Properties.Resources.preview;
|
||||
previewPanel.SizeMode = PictureBoxSizeMode.CenterImage;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ClassIDType.Shader:
|
||||
case ClassIDType.TextAsset:
|
||||
@@ -504,7 +502,6 @@ namespace AssetStudioGUI
|
||||
fontPreviewBox.Visible = !fontPreviewBox.Visible;
|
||||
break;
|
||||
case ClassIDType.AudioClip:
|
||||
{
|
||||
FMODpanel.Visible = !FMODpanel.Visible;
|
||||
|
||||
if (sound.hasHandle() && channel.hasHandle())
|
||||
@@ -520,18 +517,13 @@ namespace AssetStudioGUI
|
||||
{
|
||||
PreviewAsset(lastSelectedItem);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (lastSelectedItem != null && enablePreview.Checked)
|
||||
{
|
||||
PreviewAsset(lastSelectedItem);
|
||||
}
|
||||
|
||||
Properties.Settings.Default.enablePreview = enablePreview.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
@@ -546,7 +538,6 @@ namespace AssetStudioGUI
|
||||
{
|
||||
assetInfoLabel.Visible = false;
|
||||
}
|
||||
|
||||
Properties.Settings.Default.displayInfo = displayInfo.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
@@ -756,42 +747,40 @@ namespace AssetStudioGUI
|
||||
assetListView.SelectedIndices.Clear();
|
||||
selectedIndicesPrevList.Clear();
|
||||
selectedAnimationAssetsList.Clear();
|
||||
if (sortColumn == 4) //FullSize
|
||||
switch (sortColumn)
|
||||
{
|
||||
case 4: //FullSize
|
||||
visibleAssets.Sort((a, b) =>
|
||||
{
|
||||
var asf = a.FullSize;
|
||||
var bsf = b.FullSize;
|
||||
return reverseSort ? bsf.CompareTo(asf) : asf.CompareTo(bsf);
|
||||
});
|
||||
}
|
||||
else if (sortColumn == 3) // PathID
|
||||
{
|
||||
break;
|
||||
case 3: //PathID
|
||||
visibleAssets.Sort((x, y) =>
|
||||
{
|
||||
long pathID_X = x.m_PathID;
|
||||
long pathID_Y = y.m_PathID;
|
||||
return reverseSort ? pathID_Y.CompareTo(pathID_X) : pathID_X.CompareTo(pathID_Y);
|
||||
});
|
||||
}
|
||||
else if (sortColumn == 0) // Name
|
||||
{
|
||||
break;
|
||||
case 0: //Name
|
||||
visibleAssets.Sort((a, b) =>
|
||||
{
|
||||
var at = a.SubItems[sortColumn].Text;
|
||||
var bt = b.SubItems[sortColumn].Text;
|
||||
return reverseSort ? alphanumComparator.Compare(bt, at) : alphanumComparator.Compare(at, bt);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
default:
|
||||
visibleAssets.Sort((a, b) =>
|
||||
{
|
||||
var at = a.SubItems[sortColumn].Text.AsSpan();
|
||||
var bt = b.SubItems[sortColumn].Text.AsSpan();
|
||||
|
||||
return reverseSort ? bt.CompareTo(at, StringComparison.OrdinalIgnoreCase) : at.CompareTo(bt, StringComparison.OrdinalIgnoreCase);
|
||||
});
|
||||
break;
|
||||
}
|
||||
assetListView.EndUpdate();
|
||||
}
|
||||
@@ -818,16 +807,13 @@ namespace AssetStudioGUI
|
||||
|
||||
switch (tabControl2.SelectedIndex)
|
||||
{
|
||||
case 0: //Preview
|
||||
if (enablePreview.Checked)
|
||||
{
|
||||
case 0 when enablePreview.Checked: //Preview
|
||||
PreviewAsset(lastSelectedItem);
|
||||
if (displayInfo.Checked && lastSelectedItem.InfoText != null)
|
||||
{
|
||||
assetInfoLabel.Text = lastSelectedItem.InfoText;
|
||||
assetInfoLabel.Visible = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1: //Dump
|
||||
DumpAsset(lastSelectedItem);
|
||||
@@ -970,7 +956,11 @@ namespace AssetStudioGUI
|
||||
{
|
||||
var bitmap = new DirectBitmap(image);
|
||||
image.Dispose();
|
||||
assetItem.InfoText = $"Width: {m_Texture2D.m_Width}\nHeight: {m_Texture2D.m_Height}\nFormat: {m_Texture2D.m_TextureFormat}";
|
||||
|
||||
assetItem.InfoText =
|
||||
$"Width: {m_Texture2D.m_Width}" +
|
||||
$"\nHeight: {m_Texture2D.m_Height}" +
|
||||
$"\nFormat: {m_Texture2D.m_TextureFormat}";
|
||||
switch (m_Texture2D.m_TextureSettings.m_FilterMode)
|
||||
{
|
||||
case 0: assetItem.InfoText += "\nFilter mode: Point "; break;
|
||||
@@ -984,8 +974,8 @@ namespace AssetStudioGUI
|
||||
case 1: assetItem.InfoText += "\nWrap mode: Clamp"; break;
|
||||
}
|
||||
assetItem.InfoText += "\nChannels: ";
|
||||
int validChannel = 0;
|
||||
for (int i = 0; i < 4; i++)
|
||||
var validChannel = 0;
|
||||
for (var i = 0; i < 4; i++)
|
||||
{
|
||||
if (textureChannels[i])
|
||||
{
|
||||
@@ -998,10 +988,10 @@ namespace AssetStudioGUI
|
||||
if (validChannel != 4)
|
||||
{
|
||||
var bytes = bitmap.Bits;
|
||||
for (int i = 0; i < bitmap.Height; i++)
|
||||
for (var i = 0; i < bitmap.Height; i++)
|
||||
{
|
||||
int offset = Math.Abs(bitmap.Stride) * i;
|
||||
for (int j = 0; j < bitmap.Width; j++)
|
||||
var offset = Math.Abs(bitmap.Stride) * i;
|
||||
for (var j = 0; j < bitmap.Width; j++)
|
||||
{
|
||||
bytes[offset] = textureChannels[0] ? bytes[offset] : validChannel == 1 && textureChannels[3] ? byte.MaxValue : byte.MinValue;
|
||||
bytes[offset + 1] = textureChannels[1] ? bytes[offset + 1] : validChannel == 1 && textureChannels[3] ? byte.MaxValue : byte.MinValue;
|
||||
@@ -1012,7 +1002,9 @@ namespace AssetStudioGUI
|
||||
}
|
||||
}
|
||||
var switchSwizzled = m_Texture2D.m_PlatformBlob.Length != 0;
|
||||
assetItem.InfoText += assetItem.Asset.platform == BuildTarget.Switch ? $"\nUses texture swizzling: {switchSwizzled}" : "";
|
||||
assetItem.InfoText += assetItem.Asset.platform == BuildTarget.Switch
|
||||
? $"\nUses texture swizzling: {switchSwizzled}"
|
||||
: "";
|
||||
PreviewTexture(bitmap);
|
||||
|
||||
StatusStripUpdate("'Ctrl'+'R'/'G'/'B'/'A' for Channel Toggle");
|
||||
@@ -1173,7 +1165,10 @@ namespace AssetStudioGUI
|
||||
_ = system.getMasterChannelGroup(out var channelGroup);
|
||||
result = system.playSound(sound, channelGroup, paused, out channel);
|
||||
if (ERRCHECK(result)) return;
|
||||
if (!paused) { timer.Start(); }
|
||||
if (!paused)
|
||||
{
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
FMODpanel.Visible = true;
|
||||
|
||||
@@ -1316,6 +1311,7 @@ namespace AssetStudioGUI
|
||||
if (m_Mesh.m_VertexCount > 0)
|
||||
{
|
||||
viewMatrixData = Matrix4.CreateRotationY(-MathF.PI / 4) * Matrix4.CreateRotationX(-MathF.PI / 6);
|
||||
|
||||
#region Vertices
|
||||
if (m_Mesh.m_Vertices == null || m_Mesh.m_Vertices.Length == 0)
|
||||
{
|
||||
@@ -1359,6 +1355,7 @@ namespace AssetStudioGUI
|
||||
float d = Math.Max(1e-5f, dist.Length);
|
||||
modelMatrixData = Matrix4.CreateTranslation(-offset) * Matrix4.CreateScale(2f / d);
|
||||
#endregion
|
||||
|
||||
#region Indicies
|
||||
indiceData = new int[m_Mesh.m_Indices.Count];
|
||||
for (int i = 0; i < m_Mesh.m_Indices.Count; i = i + 3)
|
||||
@@ -1368,6 +1365,7 @@ namespace AssetStudioGUI
|
||||
indiceData[i + 2] = (int)m_Mesh.m_Indices[i + 2];
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Normals
|
||||
if (m_Mesh.m_Normals != null && m_Mesh.m_Normals.Length > 0)
|
||||
{
|
||||
@@ -1386,6 +1384,7 @@ namespace AssetStudioGUI
|
||||
}
|
||||
else
|
||||
normalData = null;
|
||||
|
||||
// calculate normal by ourself
|
||||
normal2Data = new Vector3[m_Mesh.m_VertexCount];
|
||||
int[] normalCalculatedCount = new int[m_Mesh.m_VertexCount];
|
||||
@@ -1414,6 +1413,7 @@ namespace AssetStudioGUI
|
||||
normal2Data[i] /= normalCalculatedCount[i];
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Colors
|
||||
if (m_Mesh.m_Colors != null && m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
||||
{
|
||||
@@ -1448,6 +1448,7 @@ namespace AssetStudioGUI
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
glControl1.Visible = true;
|
||||
CreateVAO();
|
||||
StatusStripUpdate("Using OpenGL Version: " + GL.GetString(StringName.Version) + "\n"
|
||||
@@ -1589,7 +1590,7 @@ namespace AssetStudioGUI
|
||||
{
|
||||
switch (tabControl2.SelectedIndex)
|
||||
{
|
||||
case 0: //Preview
|
||||
case 0 when enablePreview.Checked: //Preview
|
||||
if (lastPreviewItem != lastSelectedItem)
|
||||
{
|
||||
PreviewAsset(lastSelectedItem);
|
||||
@@ -1657,11 +1658,11 @@ namespace AssetStudioGUI
|
||||
break;
|
||||
}
|
||||
}
|
||||
exportAnimatorWithSelectedAnimationClipMenuItem.Visible = (selectedTypes & SelectedAssetType.Animator) !=0 && (selectedTypes & SelectedAssetType.AnimationClip) != 0;
|
||||
exportAnimatorWithSelectedAnimationClipMenuItem.Visible = (selectedTypes & SelectedAssetType.Animator) != 0 && (selectedTypes & SelectedAssetType.AnimationClip) != 0;
|
||||
exportAsLive2DModelToolStripMenuItem.Visible = (selectedTypes & SelectedAssetType.MonoBehaviourMoc) != 0;
|
||||
exportL2DWithFadeLstToolStripMenuItem.Visible = (selectedTypes & SelectedAssetType.MonoBehaviourMoc) !=0 && (selectedTypes & SelectedAssetType.MonoBehaviourFadeLst) != 0;
|
||||
exportL2DWithFadeToolStripMenuItem.Visible = (selectedTypes & SelectedAssetType.MonoBehaviourMoc) != 0 && (selectedTypes & SelectedAssetType.MonoBehaviourFade) !=0;
|
||||
exportL2DWithClipsToolStripMenuItem.Visible = (selectedTypes & SelectedAssetType.MonoBehaviourMoc) !=0 && (selectedTypes & SelectedAssetType.AnimationClip) != 0;
|
||||
exportL2DWithFadeLstToolStripMenuItem.Visible = (selectedTypes & SelectedAssetType.MonoBehaviourMoc) != 0 && (selectedTypes & SelectedAssetType.MonoBehaviourFadeLst) != 0;
|
||||
exportL2DWithFadeToolStripMenuItem.Visible = (selectedTypes & SelectedAssetType.MonoBehaviourMoc) != 0 && (selectedTypes & SelectedAssetType.MonoBehaviourFade) != 0;
|
||||
exportL2DWithClipsToolStripMenuItem.Visible = (selectedTypes & SelectedAssetType.MonoBehaviourMoc) != 0 && (selectedTypes & SelectedAssetType.AnimationClip) != 0;
|
||||
}
|
||||
|
||||
var selectedElement = assetListView.HitTest(new Point(e.X, e.Y));
|
||||
@@ -1733,7 +1734,7 @@ namespace AssetStudioGUI
|
||||
saveDirectoryBackup = saveFolderDialog.Folder;
|
||||
var exportPath = Path.Combine(saveFolderDialog.Folder, "GameObject") + Path.DirectorySeparatorChar;
|
||||
List<AssetItem> animationList = null;
|
||||
if(animation && selectedAnimationAssetsList.Count > 0)
|
||||
if (animation && selectedAnimationAssetsList.Count > 0)
|
||||
{
|
||||
animationList = selectedAnimationAssetsList;
|
||||
}
|
||||
@@ -1960,6 +1961,7 @@ namespace AssetStudioGUI
|
||||
{
|
||||
visibleAssets = exportableAssets;
|
||||
}
|
||||
|
||||
if (listSearch.Text != " Filter ")
|
||||
{
|
||||
var mode = (ListSearchFilterMode)listSearchFilterMode.SelectedIndex;
|
||||
@@ -1986,14 +1988,10 @@ namespace AssetStudioGUI
|
||||
var regexOptions = RegexOptions.IgnoreCase | RegexOptions.Singleline;
|
||||
try
|
||||
{
|
||||
if (mode == ListSearchFilterMode.RegexName)
|
||||
{
|
||||
visibleAssets = visibleAssets.FindAll(x => Regex.IsMatch(x.Text, pattern, regexOptions));
|
||||
}
|
||||
else
|
||||
{
|
||||
visibleAssets = visibleAssets.FindAll(x => Regex.IsMatch(x.SubItems[1].Text, pattern, regexOptions));
|
||||
}
|
||||
visibleAssets = mode == ListSearchFilterMode.RegexName
|
||||
? visibleAssets.FindAll(x => Regex.IsMatch(x.Text, pattern, regexOptions))
|
||||
: visibleAssets.FindAll(x => Regex.IsMatch(x.SubItems[1].Text, pattern, regexOptions));
|
||||
|
||||
listSearch.BackColor = SystemInformation.HighContrast ? listSearch.BackColor : System.Drawing.Color.PaleGreen;
|
||||
listSearch.ForeColor = isDarkMode ? System.Drawing.Color.Black : listSearch.ForeColor;
|
||||
}
|
||||
@@ -2338,24 +2336,25 @@ namespace AssetStudioGUI
|
||||
var selectedClips = new List<AnimationClip>();
|
||||
foreach (var assetItem in selectedAssets)
|
||||
{
|
||||
if (assetItem.Asset is MonoBehaviour m_MonoBehaviour && m_MonoBehaviour.m_Script.TryGet(out var m_Script))
|
||||
switch (assetItem.Asset)
|
||||
{
|
||||
if (m_Script.m_ClassName == "CubismMoc")
|
||||
case MonoBehaviour m_MonoBehaviour when m_MonoBehaviour.m_Script.TryGet(out var m_Script):
|
||||
switch (m_Script.m_ClassName)
|
||||
{
|
||||
case "CubismMoc":
|
||||
selectedMocs.Add(m_MonoBehaviour);
|
||||
}
|
||||
else if (m_Script.m_ClassName == "CubismFadeMotionData")
|
||||
{
|
||||
break;
|
||||
case "CubismFadeMotionData":
|
||||
selectedFadeMotions.Add(m_MonoBehaviour);
|
||||
}
|
||||
else if (m_Script.m_ClassName == "CubismFadeMotionList")
|
||||
{
|
||||
break;
|
||||
case "CubismFadeMotionList":
|
||||
selectedFadeLst = m_MonoBehaviour;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (assetItem.Asset is AnimationClip m_AnimationClip)
|
||||
{
|
||||
break;
|
||||
case AnimationClip m_AnimationClip:
|
||||
selectedClips.Add(m_AnimationClip);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (selectedMocs.Count == 0)
|
||||
@@ -2501,7 +2500,7 @@ namespace AssetStudioGUI
|
||||
private void useAssetLoadingViaTypetreeToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
var isEnabled = useAssetLoadingViaTypetreeToolStripMenuItem.Checked;
|
||||
assetsManager.LoadingViaTypeTreeEnabled = isEnabled;
|
||||
assetsManager.LoadViaTypeTree = isEnabled;
|
||||
Properties.Settings.Default.useTypetreeLoading = isEnabled;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
@@ -2729,7 +2728,7 @@ namespace AssetStudioGUI
|
||||
_ = system.getMasterChannelGroup(out var channelGroup);
|
||||
timer.Start();
|
||||
var result = channel.isPlaying(out var playing);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
@@ -2748,14 +2747,14 @@ namespace AssetStudioGUI
|
||||
{
|
||||
result = system.playSound(sound, channelGroup, false, out channel);
|
||||
if (ERRCHECK(result)) { return; }
|
||||
FMODstatusLabel.Text = "Playing";
|
||||
|
||||
FMODstatusLabel.Text = "Playing";
|
||||
if (FMODprogressBar.Value > 0)
|
||||
{
|
||||
uint newms = FMODlenms / 1000 * (uint)FMODprogressBar.Value;
|
||||
|
||||
result = channel.setPosition(newms, FMOD.TIMEUNIT.MS);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
@@ -2769,7 +2768,7 @@ namespace AssetStudioGUI
|
||||
if (sound.hasHandle() && channel.hasHandle())
|
||||
{
|
||||
var result = channel.isPlaying(out var playing);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
@@ -2778,6 +2777,7 @@ namespace AssetStudioGUI
|
||||
{
|
||||
result = channel.getPaused(out var paused);
|
||||
if (ERRCHECK(result)) { return; }
|
||||
|
||||
result = channel.setPaused(!paused);
|
||||
if (ERRCHECK(result)) { return; }
|
||||
|
||||
@@ -2802,7 +2802,7 @@ namespace AssetStudioGUI
|
||||
if (channel.hasHandle())
|
||||
{
|
||||
var result = channel.isPlaying(out var playing);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
@@ -2811,6 +2811,7 @@ namespace AssetStudioGUI
|
||||
{
|
||||
result = channel.stop();
|
||||
if (ERRCHECK(result)) { return; }
|
||||
|
||||
//channel = null;
|
||||
//don't FMODreset, it will nullify the sound
|
||||
timer.Stop();
|
||||
@@ -2837,13 +2838,13 @@ namespace AssetStudioGUI
|
||||
if (channel.hasHandle())
|
||||
{
|
||||
result = channel.isPlaying(out var playing);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
|
||||
result = channel.getPaused(out var paused);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
@@ -2851,7 +2852,7 @@ namespace AssetStudioGUI
|
||||
if (playing || paused)
|
||||
{
|
||||
result = channel.setMode(loopMode);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
@@ -2889,18 +2890,21 @@ namespace AssetStudioGUI
|
||||
uint newms = FMODlenms / 1000 * (uint)FMODprogressBar.Value;
|
||||
|
||||
var result = channel.setPosition(newms, FMOD.TIMEUNIT.MS);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
|
||||
result = channel.isPlaying(out var playing);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
if (ERRCHECK(result)) { return; }
|
||||
}
|
||||
|
||||
if (playing) { timer.Start(); }
|
||||
if (playing)
|
||||
{
|
||||
timer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2913,19 +2917,19 @@ namespace AssetStudioGUI
|
||||
if (channel.hasHandle())
|
||||
{
|
||||
var result = channel.getPosition(out ms, FMOD.TIMEUNIT.MS);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
ERRCHECK(result);
|
||||
}
|
||||
|
||||
result = channel.isPlaying(out playing);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
ERRCHECK(result);
|
||||
}
|
||||
|
||||
result = channel.getPaused(out paused);
|
||||
if ((result != FMOD.RESULT.OK) && (result != FMOD.RESULT.ERR_INVALID_HANDLE))
|
||||
if (result != FMOD.RESULT.OK && result != FMOD.RESULT.ERR_INVALID_HANDLE)
|
||||
{
|
||||
ERRCHECK(result);
|
||||
}
|
||||
|
||||
@@ -89,19 +89,18 @@ namespace AssetStudioGUI
|
||||
{
|
||||
var m_TextAsset = (TextAsset)item.Asset;
|
||||
var extension = ".txt";
|
||||
var assetExtension = Path.GetExtension(m_TextAsset.m_Name);
|
||||
if (Properties.Settings.Default.restoreExtensionName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(assetExtension))
|
||||
if (Path.HasExtension(m_TextAsset.m_Name))
|
||||
{
|
||||
extension = "";
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(item.Container))
|
||||
else
|
||||
{
|
||||
var ext = Path.GetExtension(item.Container);
|
||||
if (!string.IsNullOrEmpty(item.Container))
|
||||
var extFromContainer = Path.GetExtension(item.Container);
|
||||
if (!string.IsNullOrEmpty(extFromContainer))
|
||||
{
|
||||
extension = ext;
|
||||
extension = extFromContainer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,13 +33,14 @@ namespace AssetStudio
|
||||
|
||||
public TypeDefinition GetTypeDefinition(string assemblyName, string fullName)
|
||||
{
|
||||
moduleDic.TryGetValue(assemblyName, out var module);
|
||||
if (module == null && !assemblyName.Contains(".dll"))
|
||||
if (!moduleDic.TryGetValue(assemblyName, out var module) && !assemblyName.EndsWith(".dll"))
|
||||
{
|
||||
moduleDic.TryGetValue(assemblyName + ".dll", out module);
|
||||
assemblyName += ".dll";
|
||||
moduleDic.TryGetValue(assemblyName, out module);
|
||||
}
|
||||
if (module != null)
|
||||
{
|
||||
if (module == null)
|
||||
return null;
|
||||
|
||||
var typeDef = module.GetType(fullName);
|
||||
if (typeDef == null && assemblyName == "UnityEngine.dll")
|
||||
{
|
||||
@@ -54,8 +55,6 @@ namespace AssetStudio
|
||||
}
|
||||
return typeDef;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user