remove OffscreenCanvas to fix errors #24024
Closed
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.
Related issue: N/A
Description
When exporting a model with images to gltf format, an error occurs:
GLTFExporter.js:1134 Uncaught (in promise) TypeError: canvas.toDataURL is not a function
at GLTFWriter.processImage (GLTFExporter.js:1134:27)
at GLTFWriter.processTexture (GLTFExporter.js:1192:17)
at GLTFWriter.processMaterial (GLTFExporter.js:1274:42)
at GLTFWriter.processMesh (GLTFExporter.js:1665:26)
at GLTFWriter.processNode (GLTFExporter.js:1952:27)
at GLTFWriter.processNode (GLTFExporter.js:1974:29)
at GLTFWriter.processScene (GLTFExporter.js:2028:28)
at GLTFWriter.processInput (GLTFExporter.js:2084:10)
at GLTFWriter.write (GLTFExporter.js:437:8)
at GLTFExporter.parse (GLTFExporter.js:120:10)
The easiest solution is to remove OffscreenCanvas and use ordinary canvas uniformly.