Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 1.79 KB

README.md

File metadata and controls

33 lines (19 loc) · 1.79 KB

after-effects-utilities

For the moment, this repository only has one useful expression: spring-easing.

spring-easing

Other implementations of spring dynamics I have found are incredibly inefficient, bringing my new macbook pro down to its knees. This implements the analytic solution to the energy equations of damped harmonic oscillators, solved for position over time instead of requiring computationally inefficient recursion. For more information about the relevant physics and the analytic solution, see this course outline.

Known issues

  • When the oscillations carry over past the next value change (see example below with animationSpeed = 0.5 and springDamping = 0.3), the value is reset. I believe it would be possible to fix this fairly easily.
  • The minified version doesn't work.

Instructions

Simply copy-paste the entire expression wherever a property needs to be springy. Leave keyframe interpolation as "linear".

Example: applying the expression to position keyframes

Applying the expression to position keyframes

Result with animationSpeed = 1.2 and springDamping = 1:

Default values

Result with animationSpeed = 1.2 and springDamping = 3:

High damping

Result with animationSpeed = 1.2 and springDamping = 0.3:

Low damping

Result with animationSpeed = 0.5 and springDamping = 0.3:

Low damping low speed