Open robertlong opened 1 year ago
Thanks! It feels a bit weird that now I need to handle things different depending on if I want to export a glTF or a glb (exposing these internals, basically).
Just an idea, what do you think about:
shouldUseInternalBuffer
privateshouldUseInternalBuffer
whether the data should be shoveled into a bufferView or onto disk?Here's where I'm using it right now: https://github.com/matrix-org/thirdroom-unity-exporter/blob/main/Packages/thirdroom-unity-exporter/Runtime/Scripts/KHR_audio/KHR_AudioExtension.cs#L123
I think that approach would work well 👍 I'll switch over to it and update this PR when I do.
A couple months later, but I finally made the change @hybridherbst
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: