-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
JSM: Exporters: Create ES modules. #15592
Conversation
Should the |
I left them out of the script because there were some manual changes that would have to be repeated, and I’m not sure how to include them in the script. GLTFExporter has several active PRs, and OBJExporter has one somewhat stale PR. I think all except GLTFExporter could consider the ES modules canonical now. |
Would it be workable to add the And for Math could maybe we could do something like the following for the return `new ${ p1 === 'Math' ? '_Math' : p1 }(`; And update the imports generation line to var keys = Object.keys( dependencies )
.sort()
.map( value => '\n\t' + value )
.map(key => key === 'Math' ? 'Math as _Math' : key)
.toString(); I think |
Done, although it's a little messy... Definitely seeing some value in getting these off of the modularize script and considering them canonical sooner than later. 😓 |
@donmccurdy I've made a PR here to help with that. Feedback appreciated! |
Great, thanks! Let's review and merge #15599 and then I'll polish up this PR after that. :) |
@donmccurdy #15582 is now merged. Would it make sense to update this PR/rerun the script before merging this one? |
I'm glad to update this, although note that some of my changes to the modularize script in this PR (e.g. support Or if we would like to keep on with the existing script, I'll update this PR. |
Well, I just want to ensure that people can use Maybe we fix |
That's fine with me. 👍 Unless @mrdoob has another preference I'll rebase this PR and re-run the script. |
Sorry for the delay. Lets sort this out this cycle 🙌 @donmccurdy do you mind resolving the conflicts in this pr? |
2579baa
to
8da957e
Compare
Ok, the PR is up to date. I've tested the four that have examples. The other three (MMDExporter, TypedGeometryExporter, PLYExporter) don't have examples or tests, but static analysis for unused or undefined variables is passing and the imports are all there. I'll point out that the long |
Original exporter code. I found a case where it could emit a null set of primitive indices which causes an importer I'm using to crash, and I'm adding an option to allow the user of the exporter to strip geom attributes (again because an importer I'm using fails if the glTF file contains a |
Thanks! |
@garyo Ok thanks! Maybe better to just open the PR against the original file for now, there could be some rebase churn for a while trying to include the generated JSM. |
The original file meaning the non-JSM file 😅 |
I did both before I saw this -- feel free to adjust as needed or let me know & I'll omit the JSM. (The JSM is what I'm using.) |
A couple issues had to be cleaned up by hand:
Math
->_Math
THREE.Foo
references.