-
Notifications
You must be signed in to change notification settings - Fork 120
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
fix: GLTFExporter update #167
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
canvas.width = Math.min(image.width, options.maxTextureSize) | ||
canvas.height = Math.min(image.height, options.maxTextureSize) | ||
canvas.width = Math.min(image.width, options.maxTextureSize!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is horrible but let me know how you want to handle this and I'll fix it?
|
||
const context = canvas.getContext('2d') | ||
|
||
if (!context) throw new Error('No context') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is maybe horrible too? Let me know how you like to handle this
Hi, I've written two comments: i) non-null assertion I wrote seems bad; ii) "if no context then throw error" might not be how you like to handle this. Let me know your preferred way to handle these cases and I can change the code! Also, IIRC this is tested by running the storybook. There isn't a story for GLTFExporter yet. I just tried to start writing one, the Storybook setup isn't easy to understand though, it's not like I can just write some react. What I would think to do is to put a button or a click handler on a mesh, so you click the button or the mesh to export the GLTF. It's not immediately clear to me how to do this, if you could let me know or point me to some prior docs that would help with this then I can! |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 861a62f:
|
Thanks for that @CodyJasonBennett, I tested the package that was built for CSB with This is what it's supposed to look like: I'm pretty clueless about this code tbh, I just tried copying across stuff from the diff between when this was last updated and it doesn't seem to have worked unfortunately. Any suggestions? |
I just ran into the same issue. The working example linked from the three docs (https://threejs.org/examples/#misc_exporter_gltf) import {GLTFExporter} from "three/addons/exporters/GLTFExporter.js"; |
Continuing in #241. |
Why
GLTFExporter stopped working
What
Copied some code across from
three/jsm/examples
Checklist