work in progress: avoid shipping a modify copy of three's GLTFLoader and DRACOLoader#232
Open
TimKraemer wants to merge 1 commit into
Open
work in progress: avoid shipping a modify copy of three's GLTFLoader and DRACOLoader#232TimKraemer wants to merge 1 commit into
TimKraemer wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation:
The primary goal of this pull request is to enhance the CLI functionality within a Node environment. This initiative was prompted by challenges encountered due to the current inclusion of modified versions of
GLTFLoaderandDRACOLoaderinsrc/bin. These versions, being outdated, have led to issues, particularly in generating correctly structured JSX.Proposed Changes:
Refactoring GLTFLoader:
To make it work I just had to remove one line in https://github.com/pmndrs/three-stdlib/loaders/GLTFLoader.js:
const URL = self.URL || self.webkitURLI assume that
URLalready exists in node. This probably needs a condition to not break browser use...Unfortunately I'm not speaking typescript and don't understand enough of the project to create a pull-request directly in three-stdlib.
Adapting DRACOLoader:
Addressing the
DRACOLoaderwas more complex due to extensive browser dependencies. As a workaround, I incorporated theDRACOLoaderfrom Brakebein/node-three-gltf. This is a temporary measure untilDRACOLoaderinthree-stdlibis optimized for Node/CLI usage.Package Updates:
I have also updated various packages to their latest versions. Note: The update excludes
prettier. If these updates cause any conflicts, they can be excluded from this pull request.Caveats and Future Work:
three-stdlib.DRACOLoaderdirectly fromthree-stdlib, post its adaptation for Node/CLI environments.Conclusion:
This pull request is functional and addresses the immediate issues with CLI functionality in a Node environment. However, it needs further refinements and potential contributions to
three-stdlibfor a more integrated approach.