Hyle

Scale and spin with inertia

Will apply spinning and scaling animation with inertia controls to selected layers.

Expression taken from: motion-graphics-exchange.com/after-effects/Wiggle-rubber-bounce-throw-inertia-expressions/4ad0f32a944ad

effects:
  - type: slider control
    name: Amplitude
    properties:
      slider: .05
  - type: slider control
    name: Frequency
    properties:
      slider: 2
  - type: slider control
    name: Decay
    properties:
      slider: 4
  - type: transform
    properties:
      scale:
        expression: |
          n = 0;
          if (numKeys > 0) {
            n = nearestKey(time).index;
            if (key(n).time > time) {
              n--;
            }
          }
          if (n == 0) {
            t = 0;
          } else {
            t = time - key(n).time;
          }
          if (n > 0) {
            v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
            amp = effect(\"Amplitude\")(\"Slider\");
            freq = effect(\"Frequency\")(\"Slider\");
            decay = effect(\"Decay\")(\"Slider\");
            value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
          } else {
            value;
          }
        keyframes:
          - time: 0
            value: 0
          - time: .5
            value: 100
      rotation:
        expression: |
          n = 0;
          if (numKeys > 0) {
            n = nearestKey(time).index;
            if (key(n).time > time) {
              n--;
            }
          }
          if (n == 0) {
            t = 0;
          } else {
            t = time - key(n).time;
          }
          if (n > 0) {
            v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
            amp = effect(\"Amplitude\")(\"Slider\");
            freq = effect(\"Frequency\")(\"Slider\");
            decay = effect(\"Decay\")(\"Slider\");
            value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
          } else {
            value;
          }
        keyframes:
          - time: 0
            value: -180
          - time: .5
            value: 0