Skip to content

Improve access to animation curves and clips #15664

Description

@mweatherley

What problem does this solve or what need does it fill?

Right now (especially after #15434) it's hard to do anything with curve data after it's been added to an AnimationClip. For the sake of post-processing and general reuse, it would be good if there was a way of obtaining a Curve from an AnimationCurve. This would allow, for example, the curve to be inspected, sampled, etc. without needing to actually animate something.

What solution would you like?

Use the type registry to register pointers that allow conversion dyn AnimationCurve -> dyn Curve<T> when the type of the property being animated is known extrinsically. Ideally, these could be packaged together with some utilities in order to allow something like a Box< dyn Curve<Transform>> to be extracted from an AnimationClip together with a target ID. (Note that Curve<Transform> is actually not quite the right idea, since not every property of the Transform may actually be animated.)

What alternative(s) have you considered?

Do something hacky and hijack the AnimationGraph machinery in order to get it to read out values instead of animating things. Alternatively, attempt to downcast the AnimationCurve types directly into the types used by the glTF loader.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AnimationMake things move and change over timeC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-ComplexQuite challenging from either a design or technical perspective. Ask for help!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions