Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@animoplex
animoplex / LayerNameSubstring.jsx
Last active Apr 11, 2018
Output Layer Name As Substring - After Effects Expression by Animoplex
View LayerNameSubstring.jsx
// Output Layer Name As Substring - Created by Animoplex: www.animoplex.com
// Output Last Character
lst = name.substr(name.length-1, name.length);
// Output First Character
lst = name.substr(0, 1);
// Output All Except First Two Characters
lst = name.substr(2, name.length);
@animoplex
animoplex / DistanceBasedOpacityFade.jsx
Last active Apr 11, 2018
Distance Based Opacity Fade - After Effects Expression by Animoplex
View DistanceBasedOpacityFade.jsx
// Distance Based Opacity Fade
// Original: https://helpx.adobe.com/after-effects/using/expression-examples.html
// Full Tutorial: https://www.youtube.com/watch?v=I-Acdl_l9G0&t=14s
startFade = 500;
endFade = 3000;
try {
C = thisComp.activeCamera.toWorld([0,0,0]);
} catch(err) {
w = thisComp.width * thisComp.pixelAspect;
@animoplex
animoplex / PixelLengthCalculator.jsx
Last active Apr 12, 2018
Pixel Length Calculator - After Effects Expression by Animoplex
View PixelLengthCalculator.jsx
// Pixel Length Calculator - Created by Animoplex: www.animoplex.com
// Calculates the length (in pixels) of two positions or points in 2D or 3D space.
// USE FOR: Any property that needs a dynamic length calculated.
// Variation A
// Apply to camera's Focus Distance property
length(pointOfInterest, position)
// Variation B
@animoplex
animoplex / ClampValues.jsx
Last active Jun 15, 2018
Clamp Values - After Effects Expression by Animoplex
View ClampValues.jsx
// Clamp Values - Created by Animoplex: www.animoplex.com
// Limits a slider or keyframable value with a minimum and maximum value clamp.
// Full Tutorial: https://www.youtube.com/watch?v=MITA3ygqvQY&t=313s
// Variation A: Slider (1 Value)
minVal = 0;
maxVal = 100;
clamp(effect("Size")("Slider"), minVal, maxVal)
@animoplex
animoplex / ValueExpression.jsx
Created Sep 4, 2018
Value Expression - After Effects Expression by Animoplex
View ValueExpression.jsx
// Value Expression - Created by Animoplex: www.animoplex.com
// A basic value expression for use on a property in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=6TKEcTHdGK8
// Value Example
value / 2
// Value At Time Example
valueAtTime(2)
@animoplex
animoplex / RandomExpressions.jsx
Created Sep 4, 2018
Random Expressions - After Effects Expression by Animoplex
View RandomExpressions.jsx
// Random Expressions - Created by Animoplex: www.animoplex.com
// Generate random numbers between 0 and 1 with random, seedRandom, and gaussRandom methods.
// Full Tutorial: https://www.youtube.com/watch?v=MITA3ygqvQY
// Random Examples
random() // Returns a random number between 0 and 1 on every frame
random(5) // Returns a random number between 0 and 5 on every frame
random(-5, 5) // Returns a random number between -5 and 5 on every frame
// gaussRandom Examples
@animoplex
animoplex / UniversalExpressionSyntax.jsx
Created Dec 22, 2018
Universal Expression Syntax - After Effects Expression by Animoplex
View UniversalExpressionSyntax.jsx
// 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 / JavaScriptOperatorExamples.jsx
Created Dec 25, 2018
JavaScript Operator Examples - After Effects Expression by Animoplex
View JavaScriptOperatorExamples.jsx
// 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 / SteadicamWiggle.jsx
Last active Mar 5, 2019
Steadicam Wiggle Expression
View SteadicamWiggle.jsx
// Steadicam Wiggle
wiggle(1, 10, 2, 0.25)
// Frequency: 1, Amplitude: 10, Octaves: 2, Intensity: 0.25
@animoplex
animoplex / Wiggle.jsx
Last active Mar 5, 2019
Wiggle Expression
View Wiggle.jsx
// Wiggle Expression
wiggle(2, 20)
// Frequency: 2, Amplitude: 20
You can’t perform that action at this time.