Skip to content
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

Editor: use more three/addons/* alias #27967

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Editor: use more three/addons/* alias #27967

merged 2 commits into from
Mar 22, 2024

Conversation

KalinZhang
Copy link
Contributor

@KalinZhang KalinZhang commented Mar 22, 2024

Related pr: #23406

Description

Follow #23406, use more alias in editor

Use three/addons/* and three/examples/* alias instead of ../../*

Follow #23406, use more alias in editor

const ktx2Loader = new KTX2Loader();
ktx2Loader.setTranscoderPath( '../examples/jsm/libs/basis/' );
ktx2Loader.setTranscoderPath( 'three/addons/libs/basis/' );
Copy link
Collaborator

@Mugen87 Mugen87 Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does not work. If you now import a compressed glTF asset (like coffeemat.glb) or a 3DM file the import fails and you see 404 HTTP errors in the browser console.

You can only use the addons alias if your import via ES6 import syntax. If you load from a URL e.g. via fetch, you have to use the real directoy path meaning examples/jsm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I again checked all the changes and fixed lines that do not work.
It's my bad that I only test a subset and I'll do more careful tests before my next prs. Thanks!

@Mugen87 Mugen87 modified the milestones: r164, r163 Mar 22, 2024
@Mugen87 Mugen87 merged commit 751abcd into mrdoob:dev Mar 22, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants