From After Effects¶
After Effects expressions use JavaScript or ExtendScript. Shrimply expressions use Ebi. The examples below translate common patterns.
value is the property before the expression. time, t, and local_t
are exact durations. Divide by 1s for a number in seconds. See
Property Expressions for the available inputs and functions.
Continuous motion¶
This rotates by 40 degrees per second:
time * 40
time / 1s * 40
Variables¶
Use mut for a variable you intend to reassign.
speed = 40;
speed = 20;
time * speed
mut speed = 40
speed = 20
time / 1s * 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)
value + shake(time / 1s * 5) * 20
For a 2D property, give each axis its own seed:
[
x + shake(time / 1s * 5, 0) * 20,
y + shake(time / 1s * 5, 1) * 20
]
Oscillation¶
value + Math.sin(time * 4) * 20
value + sin(time / 1s * 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)
lerp(0, 100, clamp(time / 2s, 0, 1))
Conditions¶
time < 1 ? 0 : 100
if time < 1s {
return 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 in the inspector and set Strategy to Repeat or Ping Pong.