three-stdlib
three-stdlib copied to clipboard
fix: GLTFExporter update
Why
GLTFExporter stopped working
What
Copied some code across from three/jsm/examples
Checklist
- [ ] Ready to be merged
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
three-stdlib | ✅ Ready (Inspect) | Visit Preview | Jul 22, 2022 at 0:45AM (UTC) |
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 861a62fee41f0400e9343494934bad4e3465e298:
Sandbox | Source |
---|---|
three-stdlib-ssr | Configuration |
Thanks for that @CodyJasonBennett, I tested the package that was built for CSB with yarn add https://pkg.csb.dev/pmndrs/three-stdlib/commit/861a62fe/three-stdlib
. It doesn't error or make any interesting noise in the console but it doesn't export the GLTF successfully as the exporter from examples/jsm does.
This is what it's supposed to look like:
This is what it looks 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) imports from "addons". Why not copy the code the from there?
import {GLTFExporter} from "three/addons/exporters/GLTFExporter.js";
Continuing in #241.