fix(composer): support Windows dependency file paths in GLTF loader #417
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.
Overview
When a GLTF file is exported on the Windows platform and has texture image files referenced in sub-folders, the generated GLTF file uses backslash character for folder hierarchy:
textures\\image.png
The GLTFLoader uses this url in an S3 path like
s3://bucket/textures\\image.png
which cannot be resolved by S3.Verifying Changes
Used storybook to load an existing scene in my AWS account. The scene has a model GLTF with textures set up as the following:
Before this fix the textures are not rendered and an error is shown in the browser Console:
After the fix all textures are loaded successfully.
Testing
Added a 3D model of a Tesla car that can be used for testing. Upload it to your workspace's S3 bucket / resource library and add it to a scene. With this fix all textures in the scene should load.
Legal
This project is available under the Apache 2.0 License.