Skip to content

Commit

Permalink
Expose animation_clip paths (#9392)
Browse files Browse the repository at this point in the history
Need this for a custom `AnimationPlayer` that I tick in `FixedUpdate`

# Objective

- Need access to an animation clip's `paths` from outside the module

## Solution

- Add a getter method to return a reference to `paths`

---------

Co-authored-by: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com>
  • Loading branch information
jfaz1 and tguichaoua committed Aug 11, 2023
1 parent 1e170d2 commit ad4ec14
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ impl AnimationClip {
self.duration
}

/// The bone ids mapped by their [`EntityPath`].
#[inline]
pub fn paths(&self) -> &HashMap<EntityPath, usize> {
&self.paths
}

/// Add a [`VariableCurve`] to an [`EntityPath`].
pub fn add_curve_to_path(&mut self, path: EntityPath, curve: VariableCurve) {
// Update the duration of the animation by this curve duration if it's longer
Expand Down

0 comments on commit ad4ec14

Please sign in to comment.