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

GLTFExporter: add parseAsync #22755

Merged
merged 3 commits into from Oct 30, 2021
Merged

Conversation

marcofugaro
Copy link
Contributor

Related issue: #19118 #22031

Description

This PR adds parseAsync to GLTFExporter to make it conform to other loaders/classes.

Copy link
Collaborator

@donmccurdy donmccurdy left a comment

Choose a reason for hiding this comment

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

Added a suggestion to handle at errors where possible. Won't catch everything since parse doesn't have an error handler itself, but should catch most issues.

examples/jsm/exporters/GLTFExporter.js Show resolved Hide resolved
examples/jsm/exporters/GLTFExporter.js Outdated Show resolved Hide resolved
marcofugaro and others added 2 commits October 30, 2021 00:39
Co-authored-by: Don McCurdy <dm@donmccurdy.com>
Co-authored-by: Don McCurdy <dm@donmccurdy.com>
@marcofugaro
Copy link
Contributor Author

Thanks for the suggestion @donmccurdy, we should add an onError parameter to parse() and catch the errors in the promise as well.

But this is the job for another PR. Your solution looks good for now.

@mrdoob mrdoob added this to the r135 milestone Oct 30, 2021
@mrdoob mrdoob merged commit b884bfe into mrdoob:dev Oct 30, 2021
@mrdoob
Copy link
Owner

mrdoob commented Oct 30, 2021

Thanks!

@donmccurdy
Copy link
Collaborator

... we should add an onError parameter to parse() and catch the errors in the promise as well.
But this is the job for another PR. Your solution looks good for now.

Agreed! I think we could make that backwards-compatible by detecting when options are given as the 2nd argument instead and just printing a warning.

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.

None yet

4 participants