You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now one has to io.ReadAll before passing the data slice into LoadGLTFData which wraps it in a reader, so why not pass a reader directly? Loading from file is not ideal, since assets may be embedded via //go:embed into an embed.FS (my case!), which also brings up a point of adding Load[DAE/GLTF]FromFS.
Looking at LoadDAEData, I assume it could also use a xml.NewDecoder, but if there is some arcane reasoning behind umarshaling it three times separately from a byte slice, it could just io.ReadAll to get it from the provided reader.
The text was updated successfully, but these errors were encountered:
OK, I see what you mean, that does make sense and seems like it would be simpler. I'll see about updating the functions to just take an io.Reader instead of a byte slice.
I haven't really returned to the DAE loader since I implemented the GLTF loader, to be honest - what you mention is one way that it could be simplified and cleaned up.
I added a commit (bb729df) that should resolve this for GLTF - I'm not sure about DAE because I kind of feel like just deprecating DAE entirely and moving away from it.
I'm kind of ambivalent on supporting it, considering I don't use it, the Tetra3D add-on doesn't use it, and I generally wouldn't recommend anyone else to, either.
Right now one has to
io.ReadAll
before passing the data slice intoLoadGLTFData
which wraps it in a reader, so why not pass a reader directly? Loading from file is not ideal, since assets may be embedded via//go:embed
into anembed.FS
(my case!), which also brings up a point of addingLoad[DAE/GLTF]FromFS
.Looking at
LoadDAEData
, I assume it could also use axml.NewDecoder
, but if there is some arcane reasoning behind umarshaling it three times separately from a byte slice, it could justio.ReadAll
to get it from the provided reader.The text was updated successfully, but these errors were encountered: