Feature Request: Write JSONDocument
to GLB-formatted Uint8Array
#1473
Labels
feature
New enhancement or request
JSONDocument
to GLB-formatted Uint8Array
#1473
Is your feature request related to a problem? Please describe.
I have a
JSONDocument
that I need to export as-is to GLB format.Describe the solution you'd like
A function for writing
JSONDocument
directly to GLB format.Describe alternatives you've considered
I could call readJson() to convert the
JSONDocument
to aDocument
and then call writeBinary() on that document. However, this forces the document to pass through glTF-Transform's resource graph which may modify its contents.What I've had to do instead is copy/paste bits of the glTF I/O code from Three.js to write the GLB file, but would prefer to use glTF-Transform as my all in one glTF import/export solution.
Additional context
Seeing as there's a binaryToJSON() function for reading a GLB-formatted Uint8Array directly to
JSONDocument
, it seems reasonable to have aJSONToBinary()
function for the inverse behavior (or whatever capitalization is preferred).The text was updated successfully, but these errors were encountered: