From After Effects

After Effects expressions are JavaScript, including older ExtendScript. Shrimply uses Rhai. Pasting an After Effects expression will not work.

value is the property before the expression. time is seconds. t and local_t are the same as time. The last value in the script is the result. See Expression basics for the full list.

Continuous motion

This rotates by 40 degrees per second:

time * 40

Variables

Declare a variable with let or const. Later assignments drop the keyword:

speed = 40;
speed = 20;
time * speed

Wiggle and shake

wiggle(frequency, amount) varies around the current value. Multiply time by the frequency, multiply shake by the amount, and add it to the value:

wiggle(5, 20)

For a 2D property, give each axis its own seed:

[
  x + shake(t * 5, 0) * 20,
  y + shake(t * 5, 1) * 20
]

Oscillation

value + Math.sin(time * 4) * 20

Remapping values

lerp with a clamped progress value replaces linear. This moves from 0 to 100 over two seconds:

linear(time, 0, 2, 0, 100)

Conditions

time < 1 ? 0 : 100

What Shrimply does not have

There is no thisComp, thisLayer, or link to another property. Expressions cannot read keyframes, so loopIn(), loopOut(), and valueAtTime() have nothing to call.

To loop a clip, open Playback ‣ Repeat in the inspector and set Strategy to Repeat or Ping Pong.