Skip to content

Instantly share code, notes, and snippets.

@oliviano
Last active July 23, 2026 09:04
Show Gist options
  • Select an option

  • Save oliviano/1efb6bcec00e59a395ca3a2fbe0bb71a to your computer and use it in GitHub Desktop.

Select an option

Save oliviano/1efb6bcec00e59a395ca3a2fbe0bb71a to your computer and use it in GitHub Desktop.
## AE EXPRESSION COLLECTION ##
### LINKS
[https://balyberdin.com](https://balyberdin.com/library/all/ae-expressions/)
#### WIGGLE LOOP ####
```
freq = 1;
amp = 110;
loopTime = 3; // loop time in seconds
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)
```
#### WIGGLE LOOP on 1D for 2D params ####
Add this line to end of wiggle loop code:
```
w = linear(t, 0, loopTime, wiggle1, wiggle2);
[w[0], transform.position[1]]
```
#### WIGGLE TRANFORM SHAPE ####
set wiggles per second to 0\
Temporal Phase:
```
wigglesPerSecond = 1.5;
loopTime = 3.5;
Math.cos(degreesToRadians(360*time/loopTime))*360*wigglesPerSecond + value;
```
Spatial Phase:
```
wigglesPerSecond = 1.5;
loopTime = 3.5;
Math.sin(degreesToRadians(360*time/loopTime))*360*wigglesPerSecond + value;
```
#### SCROLLING FX ####
Offset FX
Shift Center To ( create two keyframes )
```
posterizeTime(3);
loopOut("continue")
```
### Format Text
Format text to fixed numbre of decimals.
```
numSlider = thisComp.layer("Loading_BAR").effect("Loading Bar %")("Slider");
textString = parseFloat(numSlider).toFixed(1) // number of decimal points
textString + " % "
```
Format text , Padding + decimal number.
```
numSlider = thisComp.layer("Loading_BAR").effect("Loading Bar %")("Slider");
decimals = 1; // number of decimal points
minDigits = 3; // total number of digits BEFORE the decimal point (padding)
value = parseFloat(numSlider);
// build the string with fixed decimals
textString = value.toFixed(decimals);
// split into whole + decimal parts so we only pad the left side
parts = textString.split(".");
whole = parts[0];
// pad the whole-number part with leading zeros
while (whole.length < minDigits) {
whole = "0" + whole;
}
// reassemble
padded = (parts.length > 1) ? whole + "." + parts[1] : whole;
padded + " % ";
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment