Skip to content
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

gltf::import_buffers consumes Vec<u8> blob #417

Open
facundo-villa opened this issue Apr 10, 2024 · 1 comment
Open

gltf::import_buffers consumes Vec<u8> blob #417

facundo-villa opened this issue Apr 10, 2024 · 1 comment

Comments

@facundo-villa
Copy link

As it stands today gltf::import_buffers requires it's blob parameter to be a Vec<u8> since an underlying call to gltf::buffer::Data::from_source_and_blob may mutate this input blob to align it's size to a multiple of four.

I would like this parameter to be a u8 slice so we may feed it the resulting blob from a gltf::Gltf::from_slice import without having to turn that Cow into a Vec.

I suggest we make having an unaligned slice an error and return that from gltf::buffer::Data::from_source_and_blob if it's given one.

I volunteer to try to implement this under the V2 branch.

@alteous
Copy link
Member

alteous commented Apr 22, 2024

That's a sensible suggestion. Feel free to make a PR into https://github.com/alteous/gltf/tree/v2-with-extension-macro if you want. I'll be reworking this area soon nonetheless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants