Skip to content

Instantly share code, notes, and snippets.

View animoplex's full-sized avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@animoplex
animoplex / ValueExpression.jsx
Created September 4, 2018 01:47
Value Expression - After Effects Expression by Animoplex
// 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 / LinearEaseExpression.jsx
Created September 4, 2018 01:52
Linear & Ease Expression - After Effects Expression by Animoplex
// Linear & Ease Expression - Created by Animoplex: www.animoplex.com
// Basic linear and ease expressions for use on a property in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=TFXgX0IiamQ
// Linear Example
linear(time - inPoint, 0, 100)
// Ease Example
ease(time - 5, 100, 0)
@animoplex
animoplex / LoopExpression.jsx
Created September 4, 2018 01:57
Loop Expression - After Effects Expression by Animoplex
// Loop Expression - Created by Animoplex: www.animoplex.com
// Basic loop expressions for use on a property in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=XRrs9pvWGuY
// Loop Examples
loopOut("cycle", 0) // Repeat from start to finish. Default loop mode.
loopOut("pingpong", 2) // Loops last three keyframes back and forth.
loopOut("offset", 0) // Repeats animation using last keyframe as new start point.
loopOut("continue") // Does not loop, but continues onwards with current velocity.
@animoplex
animoplex / MathMethods.jsx
Created September 4, 2018 02:13
Math Methods - After Effects Expression by Animoplex
// Math Methods - Created by Animoplex: www.animoplex.com
// Use these methods to manipulate properties and numerical values in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=aIxnJBOhdBw
// Math Method Examples
// Note: You must capitalize the M in Math for these methods to work properly.
Math.abs(-2) // Returns 2
Math.ceil(1.01) // Returns 2
Math.floor(1.99) // Returns 1
Math.min(1, 2, 3) // Returns 1
@animoplex
animoplex / ToFixedExpression.jsx
Created September 4, 2018 02:23
Trim Decimals - After Effects Expression by Animoplex
// Trim Decimals with toFixed() - Created by Animoplex: www.animoplex.com
// Trim to a specific number of decimal places and add zeros if the value is a whole number.
// Full Tutorial: https://www.youtube.com/watch?v=aIxnJBOhdBw
// Trim Decimals Example
value.toFixed(2) // Outputs a value of, for example, 1 as 1.00 and 1.667 as 1.66
// Text String Trim Decimals Example
parseInt(text.sourceText).toFixed(2) // Converts text to string and trims decimals
@animoplex
animoplex / RandomExpressions.jsx
Created September 4, 2018 02:27
Random Expressions - After Effects Expression by Animoplex
// 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 / SourceText.jsx
Created September 5, 2018 00:01
Source Text Expressions - After Effects Expression by Animoplex
// Source Text Expressions - Created by Animoplex: www.animoplex.com
// A few basic ways to manipulate and combine source text with other elements.
// Full Tutorial: https://www.youtube.com/watch?v=_XeV8NEtwjg
// Text Reference Example
comp("Template").layer("Title").text.sourceText
// Source Text + Values + Strings
"(" + text.sourceText + ")"
@animoplex
animoplex / SubstringExamples.jsx
Created September 5, 2018 00:01
Substring Examples - After Effects Expression by Animoplex
// Substring Expressions - Created by Animoplex: www.animoplex.com
// Some advanced examples of substrings and text formatting combinations.
// Full Tutorial: https://www.youtube.com/watch?v=oz352OsNgnI
// Substring Examples
name.substr(0, 2) // Output everything between 0 and 2
name.substr(2, name.length) // Output everything between 2 and the last character
name.substr(name.length - 1, 1) // Output the last character
// Bonus Substring Example
@animoplex
animoplex / RegularExpressions.jsx
Created September 5, 2018 00:07
Regular Expressions - After Effects Expression by Animoplex
// Regular Expressions - Created by Animoplex: www.animoplex.com
// Complex methods of searching and replacing text dynamically.
// Full Tutorial: https://www.youtube.com/watch?v=oz352OsNgnI
// Check out http://regexr.com/
// RegEx Examples
text.sourceText.replace(/one/gi,"1").replace(/two/gi,"2") // Replace "one" with "1" and "two" with "2"
text.sourceText.replace(/-/gi,"#") // Replace "-" with "#"
// Note: The /gi flags instruct the engine to search globally for text (g) and to be case insensitive (i)
@animoplex
animoplex / AddLightness.jsx
Created September 5, 2018 14:15
Add Lightness - After Effects Expression by Animoplex
// Add Lightness - Created by Animoplex: www.animoplex.com
// Adds lightness percentage to a color value.
// Full Tutorial: https://www.youtube.com/watch?v=QkqiaPZJa1Y
// Lightness Example
moreLight = effect("Color Brightness")("Slider") / 100;
hsl = rgbToHsl(value);
assemble = [hsl[0], hsl[1], hsl[2] + moreLight, hsl[3]];
hslToRgb(assemble)