-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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 onError parameter to parse #22774
Conversation
This change introduces a syntax error which breaks the exporter:
https://raw.githack.com/marcofugaro/three.js/gltfexporter-errors/examples/misc_exporter_gltf.html |
Ups, thanks for checking! Fixed now. |
It seems the documentation page also needs a small update: https://threejs.org/docs/index.html#examples/en/exporters/GLTFExporter |
Okay, will do. What should this example become? Is it okay like this? // Parse the input and generate the glTF output
exporter.parse(
scene,
// called when the gltf has been generated
function ( gltf ) {
console.log( gltf );
downloadJSON( gltf );
},
// called when there are some error in the generations
function ( error ) {
console.log( 'An error happened' );
},
options
); Otherwise I can just put |
That looks good to me! |
Cool, all done. |
Thanks! |
Related issue: #22755 (comment)
Description
This allows us to correctly catch errors, even in the promise after
this.pending
.I did this by converting
GLTFWriter.write()
to async since it was cleaner.