mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-27 22:00:23 -04:00
fixed bug
This commit is contained in:
parent
e75b9858da
commit
40153f6f19
@ -738,6 +738,8 @@ namespace Unity_Studio
|
||||
case TextureFormat.EAC_RG:
|
||||
case TextureFormat.EAC_RG_SIGNED:
|
||||
preloadData.extension = ".ktx"; break;
|
||||
default:
|
||||
preloadData.extension = ".dat"; break;
|
||||
}
|
||||
|
||||
switch (m_FilterMode)
|
||||
|
@ -1595,7 +1595,7 @@ namespace Unity_Studio
|
||||
if (m_Texture2D.image_data == null)
|
||||
return false;
|
||||
var convert = (bool)Properties.Settings.Default["convertTexture"];
|
||||
if (convert)
|
||||
if (convert && asset.extension != ".dat")
|
||||
{
|
||||
ImageFormat format = null;
|
||||
var ext = (string)Properties.Settings.Default["convertType"];
|
||||
@ -1863,7 +1863,7 @@ namespace Unity_Studio
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string FixFileName(string str)
|
||||
public static string FixFileName(string str)
|
||||
{
|
||||
if (str.Length >= 260) return Path.GetRandomFileName();
|
||||
return Path.GetInvalidFileNameChars().Aggregate(str, (current, c) => current.Replace(c, '_'));
|
||||
|
@ -84,20 +84,32 @@ namespace Unity_Studio
|
||||
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
resetForm();
|
||||
mainPath = Path.GetDirectoryName(openFileDialog1.FileNames[0]);
|
||||
ThreadPool.QueueUserWorkItem(state =>
|
||||
{
|
||||
mainPath = Path.GetDirectoryName(openFileDialog1.FileNames[0]);
|
||||
var bundle = false;
|
||||
if (openFileDialog1.FilterIndex == 1 || openFileDialog1.FilterIndex == 3)
|
||||
{
|
||||
MergeSplitAssets(mainPath);
|
||||
|
||||
//Only verify whether the first file is bundle file
|
||||
if (CheckBundleFile(openFileDialog1.FileNames[0]))
|
||||
{
|
||||
MessageBox.Show($"{Path.GetFileName(openFileDialog1.FileNames[0])} is bundle file, please select bundle file type to load this file");
|
||||
return;
|
||||
if (openFileDialog1.FileNames.Length > 1)
|
||||
{
|
||||
MessageBox.Show($"{Path.GetFileName(openFileDialog1.FileNames[0])} is bundle file, please select bundle file type to load this file");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
bundle = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
bundle = true;
|
||||
}
|
||||
if (!bundle)
|
||||
{
|
||||
MergeSplitAssets(mainPath);
|
||||
foreach (var i in openFileDialog1.FileNames)
|
||||
{
|
||||
unityFiles.Add(i);
|
||||
@ -1463,8 +1475,10 @@ namespace Unity_Studio
|
||||
var filename = j.Text + DateTime.Now.ToString("_mm_ss_ffff");
|
||||
//选中它和它的子节点
|
||||
sceneTreeView.Invoke(new Action(() => j.Checked = true));
|
||||
//处理非法文件名
|
||||
var name = FixFileName(savePath + filename + ".fbx");
|
||||
//导出FBX
|
||||
WriteFBX(savePath + filename + ".fbx", false);
|
||||
WriteFBX(name, false);
|
||||
//取消选中
|
||||
sceneTreeView.Invoke(new Action(() => j.Checked = false));
|
||||
}
|
||||
@ -1916,9 +1930,7 @@ namespace Unity_Studio
|
||||
reverseSort = false;
|
||||
enableFiltering = false;
|
||||
|
||||
//FMODinit();
|
||||
FMODreset();
|
||||
|
||||
}
|
||||
|
||||
private void showOriginalFileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
Loading…
Reference in New Issue
Block a user