Add ability to export files and buffer views #73
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.
This PR supersedes #60.
I'm developing an exporter plugin for Third Room that has support for the
KHR_audio
extension. This includes exporting mp3 files. Files are either exported to disk and referenced viauri
or exported as a buffer view. This PR adds two new methods for exporting arbitrary files and buffer views as well as exposing theshouldUseInternalBuffer
flag for determining which method to use.When exporting as a .glb or if you just want to export arbitrary buffer views, you can now use the
exporter.ExportBufferView(byte[] bytes)
function.When exporting as a .gltf and you want to export an external file you can now use the
exporter.ExportFile(string path)
function which returns the file uri.Here's an example of this in use: