-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(composer): support Windows dependency file paths in GLTF loader #417
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a story that covers this case.
This pull request introduces 1 alert when merging 8de93a7 into b76057d - view on LGTM.com new alerts:
Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog. |
The issue is only when loading a model from S3, so we need a story that requires manual setup with an AWS account. Added an item in the backlog to do this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GLTF/BIn files need to be at the root of the public folder, there's a bug in how we implement the GLTFLoader that I haven't figured out yet, that prevents relative paths from working.
Also, please squash your commits, and make sure to use the commitlint format for commit messages.
126bfd3
to
9cbb13b
Compare
* Add example 3D model with textures referenced with Windows paths for testing
9cbb13b
to
cbe74e3
Compare
author dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1672181186 -0800 committer Mukesh Sahay <muksahay@amazon.com> 1673468961 -0800 build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 (#419) Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: upgrade video.js to remove xmldom (#447) chore(AddSVGLinting): Enforce width and height attributes on SVGs fix(composer): support Windows dependency file paths in GLTF loader (#417) * Add example 3D model with textures referenced with Windows paths for testing fix(composer): Auto expand hierarchy when selecting node on scene fix(composer): Update scene hierarchy test cases Revert "fix(composer): Update scene hierarchy test cases" This reverts commit fcf1666. Revert "fix(composer): Auto expand hierarchy when selecting node on scene" This reverts commit 0395c86. fix(composer): Auto expand hierarchy when selecting node on scene fix(composer): Add test for SceneHierarchyDataProvider fix(composer): hdr url is sometimes wrong (#352) chore: release 2.6.1 (#440) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> fix: prevent stream render if dataType unknown (#448) chore: release 2.6.2 (#455) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> fix: prevent stream render if dataType unknown (#448) chore: release 2.6.2 (#455) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.