1
0
mirror of synced 2024-11-28 09:20:57 +01:00

Add a loaded check for dae/fbx

This commit is contained in:
KillzXGaming 2019-05-03 15:40:00 -04:00
parent 6303769adb
commit db4766c63d
5 changed files with 10 additions and 2 deletions

Binary file not shown.

View File

@ -657,7 +657,10 @@ namespace Bfres.Structs
break;
default:
AssimpData assimp = new AssimpData();
assimp.LoadFile(FileName);
bool IsLoaded = assimp.LoadFile(FileName);
if (!IsLoaded)
return;
if (assimp.objects.Count == 0)
{

View File

@ -33,7 +33,7 @@ namespace Switch_Toolbox.Library
public AssimpData()
{
}
public void LoadFile(string FileName)
public bool LoadFile(string FileName)
{
try
{
@ -56,7 +56,10 @@ namespace Switch_Toolbox.Library
scene = Importer.ImportFile(FileName, settings.GetFlags());
LoadScene();
return true;
}
return false;
}
catch (Exception e)
{
@ -66,6 +69,8 @@ namespace Switch_Toolbox.Library
}
else
MessageBox.Show($"{e.ToString()}");
return false;
}
}
public void processNode()