mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-11-12 23:32:42 -05:00
Some other fixes
This commit is contained in:
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,16 +483,14 @@ namespace AssetStudioGUI
|
||||
{
|
||||
case ClassIDType.Texture2D:
|
||||
case ClassIDType.Sprite:
|
||||
if (enablePreview.Checked && imageTexture != null)
|
||||
{
|
||||
if (enablePreview.Checked && imageTexture != null)
|
||||
{
|
||||
previewPanel.Image = imageTexture.Bitmap;
|
||||
}
|
||||
else
|
||||
{
|
||||
previewPanel.Image = Properties.Resources.preview;
|
||||
previewPanel.SizeMode = PictureBoxSizeMode.CenterImage;
|
||||
}
|
||||
previewPanel.Image = imageTexture.Bitmap;
|
||||
}
|
||||
else
|
||||
{
|
||||
previewPanel.Image = Properties.Resources.preview;
|
||||
previewPanel.SizeMode = PictureBoxSizeMode.CenterImage;
|
||||
}
|
||||
break;
|
||||
case ClassIDType.Shader:
|
||||
@ -504,34 +502,28 @@ namespace AssetStudioGUI
|
||||
fontPreviewBox.Visible = !fontPreviewBox.Visible;
|
||||
break;
|
||||
case ClassIDType.AudioClip:
|
||||
FMODpanel.Visible = !FMODpanel.Visible;
|
||||
|
||||
if (sound.hasHandle() && channel.hasHandle())
|
||||
{
|
||||
FMODpanel.Visible = !FMODpanel.Visible;
|
||||
|
||||
if (sound.hasHandle() && channel.hasHandle())
|
||||
var result = channel.isPlaying(out var playing);
|
||||
if (result == FMOD.RESULT.OK && playing)
|
||||
{
|
||||
var result = channel.isPlaying(out var playing);
|
||||
if (result == FMOD.RESULT.OK && playing)
|
||||
{
|
||||
channel.stop();
|
||||
FMODreset();
|
||||
}
|
||||
channel.stop();
|
||||
FMODreset();
|
||||
}
|
||||
else if (FMODpanel.Visible)
|
||||
{
|
||||
PreviewAsset(lastSelectedItem);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
else if (FMODpanel.Visible)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
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);
|
||||
});
|
||||
case 4: //FullSize
|
||||
visibleAssets.Sort((a, b) =>
|
||||
{
|
||||
var asf = a.FullSize;
|
||||
var bsf = b.FullSize;
|
||||
return reverseSort ? bsf.CompareTo(asf) : asf.CompareTo(bsf);
|
||||
});
|
||||
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);
|
||||
});
|
||||
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);
|
||||
});
|
||||
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();
|
||||
}
|
||||
@ -813,20 +802,17 @@ namespace AssetStudioGUI
|
||||
|
||||
lastSelectedItem = (AssetItem)e.Item;
|
||||
|
||||
if (!e.IsSelected)
|
||||
if (!e.IsSelected)
|
||||
return;
|
||||
|
||||
|
||||
switch (tabControl2.SelectedIndex)
|
||||
{
|
||||
case 0: //Preview
|
||||
if (enablePreview.Checked)
|
||||
case 0 when enablePreview.Checked: //Preview
|
||||
PreviewAsset(lastSelectedItem);
|
||||
if (displayInfo.Checked && lastSelectedItem.InfoText != null)
|
||||
{
|
||||
PreviewAsset(lastSelectedItem);
|
||||
if (displayInfo.Checked && lastSelectedItem.InfoText != null)
|
||||
{
|
||||
assetInfoLabel.Text = lastSelectedItem.InfoText;
|
||||
assetInfoLabel.Visible = true;
|
||||
}
|
||||
assetInfoLabel.Text = lastSelectedItem.InfoText;
|
||||
assetInfoLabel.Visible = true;
|
||||
}
|
||||
break;
|
||||
case 1: //Dump
|
||||
@ -955,7 +941,7 @@ namespace AssetStudioGUI
|
||||
|
||||
private void PreviewTexture2DArray(AssetItem assetItem, Texture2DArray m_Texture2DArray)
|
||||
{
|
||||
assetItem.InfoText =
|
||||
assetItem.InfoText =
|
||||
$"Width: {m_Texture2DArray.m_Width}\n" +
|
||||
$"Height: {m_Texture2DArray.m_Height}\n" +
|
||||
$"Graphics format: {m_Texture2DArray.m_Format}\n" +
|
||||
@ -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;
|
||||
|
||||
@ -1182,7 +1177,7 @@ namespace AssetStudioGUI
|
||||
|
||||
FMODinfoLabel.Text = frequency + " Hz";
|
||||
FMODtimerLabel.Text = $"00:00.00 / {(FMODlenms / 1000 / 60):00}:{(FMODlenms / 1000 % 60):00}.{(FMODlenms / 10 % 100):00}";
|
||||
|
||||
|
||||
sound.getFormat(out _, out _, out var audioChannels, out _);
|
||||
switch (audioChannels)
|
||||
{
|
||||
@ -1206,7 +1201,7 @@ namespace AssetStudioGUI
|
||||
sb.AppendLine($"Frame rate: {m_VideoClip.m_FrameRate:.0##}");
|
||||
sb.AppendLine($"Split alpha: {m_VideoClip.m_HasSplitAlpha}");
|
||||
assetItem.InfoText = sb.ToString();
|
||||
|
||||
|
||||
StatusStripUpdate("Only supported export.");
|
||||
}
|
||||
|
||||
@ -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)
|
||||
{
|
||||
@ -1433,10 +1433,10 @@ namespace AssetStudioGUI
|
||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||
{
|
||||
colorData[c] = new Vector4(
|
||||
m_Mesh.m_Colors[c * 4],
|
||||
m_Mesh.m_Colors[c * 4 + 1],
|
||||
m_Mesh.m_Colors[c * 4 + 2],
|
||||
m_Mesh.m_Colors[c * 4 + 3]);
|
||||
m_Mesh.m_Colors[c * 4],
|
||||
m_Mesh.m_Colors[c * 4 + 1],
|
||||
m_Mesh.m_Colors[c * 4 + 2],
|
||||
m_Mesh.m_Colors[c * 4 + 3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1448,6 +1448,7 @@ namespace AssetStudioGUI
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
glControl1.Visible = true;
|
||||
CreateVAO();
|
||||
StatusStripUpdate("Using OpenGL Version: " + GL.GetString(StringName.Version) + "\n"
|
||||
@ -1503,7 +1504,7 @@ namespace AssetStudioGUI
|
||||
{
|
||||
if (InvokeRequired)
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
progressBar1.Value = value;
|
||||
progressBar1.Style = ProgressBarStyle.Continuous;
|
||||
@ -1515,7 +1516,7 @@ namespace AssetStudioGUI
|
||||
progressBar1.Value = value;
|
||||
}
|
||||
|
||||
BeginInvoke(new Action(() =>
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
var max = progressBar1.Maximum;
|
||||
taskbar.SetProgressValue(value, max);
|
||||
@ -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;
|
||||
}
|
||||
@ -2045,8 +2043,8 @@ namespace AssetStudioGUI
|
||||
var tex2dArrayImgPathIdSet = toExportAssets.FindAll(x => x.Type == ClassIDType.Texture2DArrayImage).Select(x => x.m_PathID).ToHashSet();
|
||||
foreach (var pathId in tex2dArrayImgPathIdSet)
|
||||
{
|
||||
toExportAssets = toExportAssets.Where(x =>
|
||||
x.Type != ClassIDType.Texture2DArray
|
||||
toExportAssets = toExportAssets.Where(x =>
|
||||
x.Type != ClassIDType.Texture2DArray
|
||||
|| (x.Type == ClassIDType.Texture2DArray && x.m_PathID != pathId))
|
||||
.ToList();
|
||||
}
|
||||
@ -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")
|
||||
{
|
||||
selectedMocs.Add(m_MonoBehaviour);
|
||||
}
|
||||
else if (m_Script.m_ClassName == "CubismFadeMotionData")
|
||||
{
|
||||
selectedFadeMotions.Add(m_MonoBehaviour);
|
||||
}
|
||||
else if (m_Script.m_ClassName == "CubismFadeMotionList")
|
||||
{
|
||||
selectedFadeLst = m_MonoBehaviour;
|
||||
}
|
||||
}
|
||||
else if (assetItem.Asset is AnimationClip m_AnimationClip)
|
||||
{
|
||||
selectedClips.Add(m_AnimationClip);
|
||||
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);
|
||||
break;
|
||||
case "CubismFadeMotionData":
|
||||
selectedFadeMotions.Add(m_MonoBehaviour);
|
||||
break;
|
||||
case "CubismFadeMotionList":
|
||||
selectedFadeLst = m_MonoBehaviour;
|
||||
break;
|
||||
}
|
||||
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);
|
||||
}
|
||||
@ -3002,9 +3006,9 @@ namespace AssetStudioGUI
|
||||
GL.GenBuffers(1, out vboAddress);
|
||||
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
||||
GL.BufferData(BufferTarget.ArrayBuffer,
|
||||
(IntPtr)(data.Length * Vector3.SizeInBytes),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
(IntPtr)(data.Length * Vector3.SizeInBytes),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
GL.VertexAttribPointer(address, 3, VertexAttribPointerType.Float, false, 0, 0);
|
||||
GL.EnableVertexAttribArray(address);
|
||||
}
|
||||
@ -3014,9 +3018,9 @@ namespace AssetStudioGUI
|
||||
GL.GenBuffers(1, out vboAddress);
|
||||
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
||||
GL.BufferData(BufferTarget.ArrayBuffer,
|
||||
(IntPtr)(data.Length * Vector4.SizeInBytes),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
(IntPtr)(data.Length * Vector4.SizeInBytes),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
GL.VertexAttribPointer(address, 4, VertexAttribPointerType.Float, false, 0, 0);
|
||||
GL.EnableVertexAttribArray(address);
|
||||
}
|
||||
@ -3032,9 +3036,9 @@ namespace AssetStudioGUI
|
||||
GL.GenBuffers(1, out address);
|
||||
GL.BindBuffer(BufferTarget.ElementArrayBuffer, address);
|
||||
GL.BufferData(BufferTarget.ElementArrayBuffer,
|
||||
(IntPtr)(data.Length * sizeof(int)),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
(IntPtr)(data.Length * sizeof(int)),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
}
|
||||
|
||||
private void CreateVAO()
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user