Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat: Generic animation system #558
Conversation
Rhuagh
added
type: improvement
status: working
project: animation
labels
Feb 1, 2018
Rhuagh
changed the title from
[WIP] feat: Generic animation system
to
feat: Generic animation system
Feb 2, 2018
Rhuagh
added
status: ready
and removed
status: working
labels
Feb 2, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Ready for review. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Feb 3, 2018
Member
This is great :)
Reviewed 19 of 19 files at r1.
Review status: all files reviewed at latest revision, 6 unresolved discussions.
amethyst_animation/src/bundle.rs, line 16 at r1 (raw file):
SamplerProcessor}; const DEP: [&str; 0] = [];
Why are you using a constant here? Isn't a reference to a ZST 'static automatically?
amethyst_animation/src/bundle.rs, line 59 at r1 (raw file):
/// Bundle for only the sampler interpolation. /// /// Will add `SamplerInterpolationSystem` with name `sampler_interpolation_system`.
sampler_processor isn't listed here
amethyst_animation/src/bundle.rs, line 93 at r1 (raw file):
builder: DispatcherBuilder<'a, 'b>, ) -> Result<DispatcherBuilder<'a, 'b>> { if !world
I think we have added an Entry API for this.
amethyst_animation/src/resources.rs, line 15 at r1 (raw file):
pub trait AnimationSampling { /// The channel type type Channel;
Maybe add the Send + Sync + 'static bounds here?
amethyst_animation/src/resources.rs, line 23 at r1 (raw file):
/// Get the current sample for a channel fn get_current_sample(&self, channel: &Self::Channel) -> SamplerPrimitive<Self::Scalar>;
Should be current_sample
amethyst_animation/src/resources.rs, line 264 at r1 (raw file):
command: AnimationCommand, ) -> Self { Self {
Please use AnimationControl for the construction
Comments from Reviewable
|
This is great :) Reviewed 19 of 19 files at r1. amethyst_animation/src/bundle.rs, line 16 at r1 (raw file):
Why are you using a constant here? Isn't a reference to a ZST 'static automatically? amethyst_animation/src/bundle.rs, line 59 at r1 (raw file):
amethyst_animation/src/bundle.rs, line 93 at r1 (raw file):
I think we have added an Entry API for this. amethyst_animation/src/resources.rs, line 15 at r1 (raw file):
Maybe add the amethyst_animation/src/resources.rs, line 23 at r1 (raw file):
Should be amethyst_animation/src/resources.rs, line 264 at r1 (raw file):
Please use Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Feb 3, 2018
Member
Review status: all files reviewed at latest revision, 6 unresolved discussions.
amethyst_animation/src/bundle.rs, line 93 at r1 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
I think we have added an Entry API for this.
Released?
Comments from Reviewable
|
Review status: all files reviewed at latest revision, 6 unresolved discussions. amethyst_animation/src/bundle.rs, line 93 at r1 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Released? Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Feb 3, 2018
Member
Review status: all files reviewed at latest revision, 6 unresolved discussions.
amethyst_animation/src/bundle.rs, line 16 at r1 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
Why are you using a constant here? Isn't a reference to a ZST 'static automatically?
Done.
amethyst_animation/src/bundle.rs, line 59 at r1 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
sampler_processorisn't listed here
Done.
amethyst_animation/src/resources.rs, line 15 at r1 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
Maybe add the
Send + Sync + 'staticbounds here?
Done.
amethyst_animation/src/resources.rs, line 23 at r1 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
Should be
current_sample
Done.
amethyst_animation/src/resources.rs, line 264 at r1 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
Please use
AnimationControlfor the construction
Done.
Comments from Reviewable
|
Review status: all files reviewed at latest revision, 6 unresolved discussions. amethyst_animation/src/bundle.rs, line 16 at r1 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Done. amethyst_animation/src/bundle.rs, line 59 at r1 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Done. amethyst_animation/src/resources.rs, line 15 at r1 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Done. amethyst_animation/src/resources.rs, line 23 at r1 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Done. amethyst_animation/src/resources.rs, line 264 at r1 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Done. Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Feb 4, 2018
Member
Reviewed 8 of 8 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions.
amethyst_animation/src/bundle.rs, line 93 at r1 (raw file):
Previously, Rhuagh (Simon Rönnberg) wrote…
Released?
Yep, https://docs.rs/shred/0.5.2/shred/struct.Resources.html#method.entry
amethyst_animation/src/bundle.rs, line 57 at r2 (raw file):
/// /// Will add `SamplerInterpolationSystem<T>` with the given name. /// Will also add `SamplerProcessor<T::Scalar>` if it has not been added yet.
I think you misunderstood the usage of add(sys, "", dependencies). It does not check if it's already added, it will just add the same system twice.
Comments from Reviewable
|
Reviewed 8 of 8 files at r2. amethyst_animation/src/bundle.rs, line 93 at r1 (raw file): Previously, Rhuagh (Simon Rönnberg) wrote…
Yep, https://docs.rs/shred/0.5.2/shred/struct.Resources.html#method.entry amethyst_animation/src/bundle.rs, line 57 at r2 (raw file):
I think you misunderstood the usage of Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Feb 5, 2018
Member
Review status: 6 of 19 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.
amethyst_animation/src/bundle.rs, line 93 at r1 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
Yep, https://docs.rs/shred/0.5.2/shred/struct.Resources.html#method.entry
Done
amethyst_animation/src/bundle.rs, line 57 at r2 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
I think you misunderstood the usage of
add(sys, "", dependencies). It does not check if it's already added, it will just add the same system twice.
Ah, no, I just messed up the docs
Comments from Reviewable
|
Review status: 6 of 19 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. amethyst_animation/src/bundle.rs, line 93 at r1 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Done amethyst_animation/src/bundle.rs, line 57 at r2 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Ah, no, I just messed up the docs Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Feb 5, 2018
Member
Review status: 6 of 19 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.
amethyst_animation/src/resources.rs, line 62 at r3 (raw file):
/// Only required for animations which target more than a single node. #[derive(Debug, Clone)] pub struct AnimationHierarchy {
This should probably be generic on T aswell
Comments from Reviewable
|
Review status: 6 of 19 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. amethyst_animation/src/resources.rs, line 62 at r3 (raw file):
This should probably be generic on T aswell Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Feb 5, 2018
Member
Reviewed 13 of 13 files at r3.
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.
amethyst_animation/src/bundle.rs, line 57 at r2 (raw file):
Previously, Rhuagh (Simon Rönnberg) wrote…
Ah, no, I just messed up the docs
Please correct it to "with the given name"
amethyst_animation/src/bundle.rs, line 97 at r3 (raw file):
.res .entry() .or_insert_with(|| AssetStorage::<Sampler<T::Primitive>>::new());
Can coerce the new function to a closure.
Comments from Reviewable
|
Reviewed 13 of 13 files at r3. amethyst_animation/src/bundle.rs, line 57 at r2 (raw file): Previously, Rhuagh (Simon Rönnberg) wrote…
Please correct it to "with the given name" amethyst_animation/src/bundle.rs, line 97 at r3 (raw file):
Can coerce the new function to a closure. Comments from Reviewable |
omni-viral
self-requested a review
Feb 6, 2018
Xaeroxe
approved these changes
Feb 7, 2018
Impressive work! LGTM! I got a couple nits but I don't consider either of them blockers.
| + Self { | ||
| + animation_name, | ||
| + sampling_name, | ||
| + dep: &[], |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Feb 7, 2018
Member
I don't see anywhere this could be something other than &[] so why not just inline that and remove this member variable?
Xaeroxe
Feb 7, 2018
Member
I don't see anywhere this could be something other than &[] so why not just inline that and remove this member variable?
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| @@ -55,21 +69,30 @@ impl Component for AnimationHierarchy { | ||
| /// Defines a single animation. | ||
| /// Defines relationships between the node index in `AnimationHierarchy` and a `Sampler` handle. | ||
| -/// If the animation only targets a single node index, `AnimationHierarchy` is not required. | ||
| +/// If the animation only target a single node index, `AnimationHierarchy` is not required. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Feb 7, 2018
Member
Review status: 15 of 19 files reviewed at latest revision, 5 unresolved discussions.
amethyst_animation/src/bundle.rs, line 57 at r2 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
Please correct it to "with the given name"
Done.
amethyst_animation/src/bundle.rs, line 97 at r3 (raw file):
Previously, torkleyy (Thomas Schaller) wrote…
Can coerce the new function to a closure.
Done.
amethyst_animation/src/resources.rs, line 62 at r3 (raw file):
Previously, Rhuagh (Simon Rönnberg) wrote…
This should probably be generic on T aswell
Done.
amethyst_animation/src/resources.rs, line 72 at r3 (raw file):
Previously, Xaeroxe (Jacob Kiesel) wrote…
targetsis the correct word here because this sentence is present tense.
Done.
Comments from Reviewable
|
Review status: 15 of 19 files reviewed at latest revision, 5 unresolved discussions. amethyst_animation/src/bundle.rs, line 57 at r2 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Done. amethyst_animation/src/bundle.rs, line 97 at r3 (raw file): Previously, torkleyy (Thomas Schaller) wrote…
Done. amethyst_animation/src/resources.rs, line 62 at r3 (raw file): Previously, Rhuagh (Simon Rönnberg) wrote…
Done. amethyst_animation/src/resources.rs, line 72 at r3 (raw file): Previously, Xaeroxe (Jacob Kiesel) wrote…
Done. Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Feb 7, 2018
Member
All comments addressed now I believe.
Review status: 15 of 19 files reviewed at latest revision, 5 unresolved discussions.
Comments from Reviewable
|
All comments addressed now I believe. Review status: 15 of 19 files reviewed at latest revision, 5 unresolved discussions. Comments from Reviewable |
| - .collect::<Result<Vec<(usize, Sampler)>, GltfError>>()? | ||
| - .into_iter() | ||
| - .unzip(); | ||
| + .collect::<Result<Vec<(usize, LocalTransformChannel, Sampler<SamplerPrimitive<f32>>)>, GltfError>>()?; |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| let output = AccessorIter::<[f32; 4]>::new(sampler.output(), buffers) | ||
| - .map(|q| [q[3], q[0], q[1], q[2]]) | ||
| + .map(|q| SamplerPrimitive::Vec4([q[3], q[0], q[1], q[2]])) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| .samplers | ||
| .iter() | ||
| .cloned() | ||
| - .map(|sampler| { | ||
| - loader.load_from_data(sampler, (), &*sampler_storage) | ||
| + .map(|(node_index, channel, ref sampler)| { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Feb 8, 2018
Member
Review status: 15 of 19 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed.
amethyst_gltf/src/systems.rs, line 234 at r4 (raw file):
Previously, omni-viral (Zakarum) wrote…
Why
ref sampledif it is cloned?
samplernow cloned two times.
Done.
amethyst_gltf/src/format/mod.rs, line 187 at r4 (raw file):
Previously, omni-viral (Zakarum) wrote…
Consider to use
Result<Vec<_>, _>and let the rest to be inferred.
Done.
amethyst_gltf/src/format/mod.rs, line 229 at r4 (raw file):
Previously, Rhuagh (Simon Rönnberg) wrote…
Or hmm, it might
Done.
Comments from Reviewable
|
Review status: 15 of 19 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. amethyst_gltf/src/systems.rs, line 234 at r4 (raw file): Previously, omni-viral (Zakarum) wrote…
Done. amethyst_gltf/src/format/mod.rs, line 187 at r4 (raw file): Previously, omni-viral (Zakarum) wrote…
Done. amethyst_gltf/src/format/mod.rs, line 229 at r4 (raw file): Previously, Rhuagh (Simon Rönnberg) wrote…
Done. Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
dismissed
omni-viral’s
stale review
Feb 9, 2018
is implicit approval
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Feb 9, 2018
Member
amethyst_animation/src/resources.rs, line 67 at r5 (raw file):
} macro_rules! hashmap {
Cool macro! We should consider moving this to core.
Comments from Reviewable
|
amethyst_animation/src/resources.rs, line 67 at r5 (raw file):
Cool macro! We should consider moving this to Comments from Reviewable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Feb 9, 2018
Member
bors r+
Reviewed 3 of 4 files at r4, 2 of 2 files at r5.
Review status: all files reviewed at latest revision, all discussions resolved.
amethyst_animation/src/resources.rs, line 67 at r5 (raw file):
Previously, Xaeroxe (Jacob Kiesel) wrote…
Cool macro! We should consider moving this to
core.
There is some crate that exposes such a macro..
Comments from Reviewable
|
bors r+ Reviewed 3 of 4 files at r4, 2 of 2 files at r5. amethyst_animation/src/resources.rs, line 67 at r5 (raw file): Previously, Xaeroxe (Jacob Kiesel) wrote…
There is some crate that exposes such a macro.. Comments from Reviewable |
bot
added a commit
that referenced
this pull request
Feb 9, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Build failed |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
bors r+ |
Rhuagh commentedFeb 1, 2018
•
edited
Edited 5 times
-
Rhuagh
edited Feb 2, 2018 (most recent)
-
Rhuagh
edited Feb 2, 2018
-
Rhuagh
edited Feb 2, 2018
-
Rhuagh
edited Feb 1, 2018
-
torkleyy
edited Feb 1, 2018
Taking a stab at making animation generic.
This change is