Don't hide out-of-memory during FBX import #4801
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If an out-of-memory exception is thrown during model import, it is usually trickled up by assimp and we can determine that it is the reason for failure. However, this particular code path in the FBX importer would just blindly swallow all exceptions and simply ignore a part of the mesh. That lead to issues where parts of a mesh or the entire model were skipped and assimp reported successful import.
I'm generally not that happy that code just catches exceptions and claims it's all fine, even though it doesn't even try to figure out what kind of exception this was. IMO this is very fragile.
Though more specifically, an out-of-memory situation should always be treated as a serious error, since it is unlikely that the following code will be able to continue.