Open sherief opened 4 years ago
Debugging this further, it looks like malformed files also abort the entire load attempt thanks to throwing from AssetMetadata::Read() upon, for example, seeing a mismatched version:
if (version.empty() || version[0] != '2') {
throw DeadlyImportError("GLTF: Unsupported glTF version: ", version);
}
This should be more graceful - CanRead() should return false, not throw an exception and unwind the callstack.
Describe the bug glTF 2.0 importer can abort Importer::ReadFile() early, failing to import supported formats.
To Reproduce A call to Importer::ReadFile() is made. In this function is the following snippet:
But the glTF 2.0 implementation of CanRead() is problematic as it calls:
And at the beginning of Asset::Load() is
Note the throw - so a throw from here aborts the loop in Importer::ReadFile() early.
Expected behavior If glTF 2.0 loading fails, Importer::ReadFile() should proceed with trying the following format not exit early.
Screenshots N/A
Desktop (please complete the following information): Windows 10 x64
Additional context Add any other context about the problem here.