Skip to content

Instantly share code, notes, and snippets.

View animoplex's full-sized avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@animoplex
animoplex / SteadicamWiggle.jsx
Last active March 5, 2019 06:51
Steadicam Wiggle Expression
// Steadicam Wiggle
wiggle(1, 10, 2, 0.25)
// Frequency: 1, Amplitude: 10, Octaves: 2, Intensity: 0.25
@animoplex
animoplex / Wiggle.jsx
Last active March 5, 2019 06:53
Wiggle Expression
// Wiggle Expression
wiggle(2, 20)
// Frequency: 2, Amplitude: 20
@animoplex
animoplex / ZOffsetUsingRadius.jsx
Created February 28, 2019 15:15
Z Offset Using Radius - After Effects Expression by Animoplex
// Z Offset Using Radius - Created by Animoplex: www.animoplex.com
// First line is the source of the offset, apply to position value on a grid of shapes
tar = thisComp.layer("TARGET").toWorld([0,0,0]);
rad = 100; // radius
mov = 500; // pixels of movement
dis = length(tar, toWorld([0,0,0]));
end = [value[0], value[1], value[2] + mov];
ease(dis, 0, rad, end, value)
@animoplex
animoplex / AlternatingOutputs.jsx
Created February 28, 2019 15:03
Alternating Outputs - After Effects Expression by Animoplex
// Alternating Outputs - Created by Animoplex: www.animoplex.com
// Output changes between "Off" and "On" (or any output of your choice) every 10 frames
f = 10; // frame interval
int = framesToTime(f);
num = Math.floor( time / int );
if (( num % 2 ) == 0 ) {
"Off" // default output
} else {
"On" // alternate output
@animoplex
animoplex / AdvancedWiggleExample.jsx
Created December 25, 2018 02:34
Advanced Wiggle Example - After Effects Expression by Animoplex
// Advanced Wiggle Example - Created by Animoplex: www.animoplex.com
// The full expression from Lesson 507 which builds an advanced wiggle expression using a pseudo effect.
// Full Tutorial: https://www.youtube.com/watch?v=b4AAkT2Xuio&t=17s
src = effect("Wiggle Control");
tog = src("Toggle");
if (tog == true) {
freq = src("Frequency");
amp = src("Amplitude");
val = wiggle(freq, amp);
@animoplex
animoplex / WhileLoopExample.jsx
Created December 25, 2018 02:32
While Loop Example - After Effects Expression by Animoplex
// JavaScript While Loop Example - Created by Animoplex: www.animoplex.com
// The JavaScript While Loop and how it can be used in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=SG3NyHmfc0s&t=225s
src = thisComp.layer("Control").effect("Acceleration")("Slider");
dur = thisComp.frameDuration;
dist = 0;
t = 0;
while (t < time) {
dist += src.valueAtTime(t) * dur;
@animoplex
animoplex / ForLoopExample.jsx
Created December 25, 2018 02:22
For Loop Example - After Effects Expression by Animoplex
// JavaScript For Loop Example - Created by Animoplex: www.animoplex.com
// The JavaScript For Loop and how it can be used in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=SG3NyHmfc0s&t=91s
myArray = [];
for (i = 0; i < thisComp.numLayers; i++) {
myArray[i] = thisComp.layer(i+1).name;
}
myArray.slice(0, thisComp.numLayers).join("\r")
@animoplex
animoplex / JavaScriptOperatorExamples.jsx
Created December 25, 2018 01:48
JavaScript Operator Examples - After Effects Expression by Animoplex
// JavaScript Operator Examples - Created by Animoplex: www.animoplex.com
// The different operators in JavaScript and their outputs.
// Full Tutorial: https://www.youtube.com/watch?v=ppCF7jS1nAs&t=18s
1 < 2 // true
1 > 2 // false
1 <= 2 // true
1 >= 2 // false
1 == 2 // false
1 != 2 // true
@animoplex
animoplex / UniversalExpressionSyntax.jsx
Created December 22, 2018 07:04
Universal Expression Syntax - After Effects Expression by Animoplex
// Universal Expression Syntax - Created by Animoplex: www.animoplex.com
// The different types of expression syntax in After Effects and how to make them compatible in any language.
// Full Tutorial: https://www.youtube.com/watch?v=b1MxtywoqHg&t=192s
// Default Compact Expression:
effect("Fill")("Color")
// Basic Universal Expression (Property Index):
// Replace the effect property’s name with the property’s index.
// Give the effect object a custom name to avoid any localization errors.
@animoplex
animoplex / AfterEffectsNumberMethods.jsx
Created December 22, 2018 06:58
After Effects Number Methods - After Effects Expression by Animoplex
// After Effects Number Methods - Created by Animoplex: www.animoplex.com
// List of compatible number methods in After Effects expressions and what they do.
// Full Tutorial: https://www.youtube.com/watch?v=l7Xd8mkqWfc&t=268s
// Outputs 10 as an integer, converting it from a string.
Number("10")
// Outputs 1 as an integer, the first valid number in the string. It ignores the second integer
parseInt("Layer 1 Copy 2")