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::animation::Sampler and gltf::animation::Channel should have .index() #398

Closed
schell opened this issue Dec 1, 2023 · 1 comment · Fixed by #419
Closed

gltf::animation::Sampler and gltf::animation::Channel should have .index() #398

schell opened this issue Dec 1, 2023 · 1 comment · Fixed by #419

Comments

@schell
Copy link
Contributor

schell commented Dec 1, 2023

First off - thanks for the great library!

I was expecting Sampler and Channel to have fn index(&self) -> usize that returns the index of the type in the Animation's samplers and channels fields, respectively.

That way we can easily associate a channel's sampler without resorting to constructing the channel's sampler and comparing against the animation's samplers.

Or maybe there's an easy way to do it that I'm missing? :)

@alteous
Copy link
Member

alteous commented Dec 4, 2023

Hi!

This looks like an oversight. We could add an index function for each for sure.

I worked with animations several years ago in three-rs. The code might be a useful reference:

https://github.com/three-rs/three/blob/master/src/factory/load_gltf.rs#L318

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

Successfully merging a pull request may close this issue.

2 participants