AssimpImporter: Fix loading of embedded textures from FBX files #128
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.
Hi @mosra,
As promised, here's the fix for #127 .
The test file was created with Blender 3.1.0 as follows:
The file now has the absolute path of the PNG embedded (C:/Users/Squareys/Desktop/embedded.png), similar to how I've seen it in "real world files", but the image data is embedded, so the loader doesn't actually access this file ever. This was ensured by renaming the image file and opening it with the Windows 3D viewer, the texture was still correctly displayed.
The test was added first, to ensure this was actually the culprit, it fails on the
image
expression, i.e. image was not found, exactly what I was observing in #127.Since the
GetEmbeddedImage()
was added with 5.0.0, I kept the legacy path behind theASSIMP_IS_VERSION_5_OR_GREATER
, but I did not test the code (really hoping the CI does this, would be a hassle to set upthe CI is testing this, luckily).I double checked the drive-by std::string => StringView/String changes, let's hope that won't blow up in my face like on the EmscriptenApplication 😅
Looking forward to the review!
Best,
Jonathan