Skip to content

Instantly share code, notes, and snippets.

View animoplex's full-sized avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@animoplex
animoplex / CheckboxExpressionLink.jsx
Last active June 29, 2020 17:11
Checkbox Expression Link - After Effects Expression by Animoplex
@animoplex
animoplex / EvaluateTextLayer.jsx
Last active August 22, 2022 11:09
Evaluate Text Layer - After Effects Expression by Animoplex
// Evaluate Text Layer - Created by Animoplex: www.animoplex.com
// Read and execute an expression from a text layer in After Effects.
// Note: Evaluated quotation marks must be straight quotes, not curly quotes.
// Full Tutorial: https://www.youtube.com/watch?v=Wkr_XOpsAFU&t=19s
eval(thisComp.layer("Text Layer 1").text.sourceText.value);
@animoplex
animoplex / 3Dto2DPosition.jsx
Last active January 29, 2023 09:41
3D to 2D Position - After Effects Expression by Animoplex
// 3D to 2D Position - Created by Animoplex: www.animoplex.com
// Give 2D effects or properties the ability to use 3D positioning in After Effects.
// toComp is a layer space transform method that transforms values from a layer space to a composition space.
// Full Tutorial: https://www.youtube.com/watch?v=FVrgLK6Zovw&t=268s
src = thisComp.layer('Layer 1');
src.toComp([0,0,0]);
@animoplex
animoplex / ChangePropertyFPS.jsx
Last active June 29, 2020 17:17
Change Property FPS - After Effects Expression by Animoplex
// Change Property FPS - Created by Animoplex: www.animoplex.com
// Gives you control of how keyframes per second are interpolated across two or more keyframes.
// Change the fps value on the first line to your desired FPS.
// Full Tutorial: https://www.youtube.com/watch?v=YLapbNyYxLs&t=257s
fps = 15;
posterizeTime(fps);
valueAtTime(time);
@animoplex
animoplex / SampleLumaValue.jsx
Last active March 30, 2023 12:26
Sample Luminance Value - After Effects Expression by Animoplex
// Sample Luminance Value - Created by Animoplex: www.animoplex.com
// Samples the luma value of a defined area and converts to a specified value within a range.
// Use samplePoint to specify luma location
// Use sampleSize to adjust the sample area
// Last line: 0 - 1 is input, 0 - 100 is output
// Full Tutorial: https://www.youtube.com/watch?v=QkqiaPZJa1Y&t=62s
target = comp("SOURCE COMP").layer("SOURCE LAYER");
samplePoint= [960,540]; // Sample location
sampleSize= [50,50]; // Sample area (in pixels)
@animoplex
animoplex / TryCatchStatement.jsx
Last active June 29, 2020 17:17
Try Catch Statement - After Effects Expression by Animoplex
// Try Catch - Created by Animoplex: www.animoplex.com
// Checks to see if a property, effect, layer, comp, or object exists.
// Note: Works like if/then statement, except if the try fails, it does not break the expression.
// Full Tutorial: https://www.youtube.com/watch?v=SG3NyHmfc0s&t=475s
try {
thisComp.layer(index + 1).value;
} catch(err) {
1;
}
@animoplex
animoplex / IfStatements.jsx
Last active June 29, 2020 17:14
If, Else If, Or, And Statements - After Effects Expression by Animoplex
// If, Else If, Or, And Statements - Created by Animoplex: www.animoplex.com
// Examples of different conditional statements to use in After Effects expressions.
// Full Tutorial: https://www.youtube.com/watch?v=ppCF7jS1nAs&t=106s
// If Statement:
if ( a > b ) {
"A Wins!";
}
// If... Else Statement
@animoplex
animoplex / InertialBounce.jsx
Last active July 19, 2024 04:43
Inertial Bounce - After Effects Expression by Animoplex
// Inertial Bounce - Created by Animoplex: www.animoplex.com
// Original Version: http://www.graymachine.com/top-5-effects-expressions/
// Modified expression for a smoother bounce effect and easier editing. Use this on any property with two keyframes to get a nice bounce effect that is based on velocity of the value change. Perfect for a scale from 0 to 100 or a speedy rotation that needs some extra life. Adjust amp, freq and decay values to tweak the effect. Amp is intensity, freq is bounces per second, and decay is the speed of decay, slow to fast.
// Full Tutorial: https://www.youtube.com/watch?v=653lxeVIyoo
amp = 5.0; freq = 2.0; decay = 4.0;
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
@animoplex
animoplex / LayerNameSubstring.jsx
Last active April 11, 2018 20:53
Output Layer Name As Substring - After Effects Expression by Animoplex
// 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 / PixelLengthCalculator.jsx
Last active April 12, 2018 16:59
Pixel Length Calculator - After Effects Expression by Animoplex
// 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