Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Animating!

Animoplex animoplex

🎯
Animating!
View GitHub Profile
@animoplex
animoplex / LoopExpression.jsx
Created Sep 4, 2018
Loop Expression - After Effects Expression by Animoplex
View LoopExpression.jsx
// 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 / AutoFadeOpacity.jsx
Last active Oct 30, 2022
Auto Fade Opacity - After Effects Expression by Animoplex
View AutoFadeOpacity.jsx
// Auto Fade Opacity - Created by Animoplex: www.animoplex.com
// Automatically fades a layer in and out based on the inPoint and outPoint of the layer.
// Full Tutorial: https://www.youtube.com/watch?v=BOPfs49VfLE&t=188s
fade = 1; // fade duration in seconds
fadeIn = (time - inPoint) / fade;
fadeOut = (outPoint - time) / fade;
if (time < inPoint + fade) {
ease(fadeIn, 0, 1) * value;
} else if (time > outPoint - fade) {
@animoplex
animoplex / InertialBounce.jsx
Last active Sep 22, 2022
Inertial Bounce - After Effects Expression by Animoplex
View InertialBounce.jsx
// 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 / MathMethods.jsx
Created Apr 16, 2018
JavaScript Math Methods - After Effects Expression by Animoplex
View MathMethods.jsx
// JavaScript Math Methods - Created by Animoplex: www.animoplex.com
// List of math methods for After Effects expressions and what they output.
// 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
Math.max(1, 2, 3) // Returns 3
Math.round(1.49) // Returns 1
@animoplex
animoplex / AfterEffectsArrayMethods.jsx
Last active Aug 22, 2022
After Effects Array Methods - After Effects Expression by Animoplex
View AfterEffectsArrayMethods.jsx
// After Effects Array Methods - Created by Animoplex: www.animoplex.com
// List of compatible array methods in After Effects expressions and what they do.
// Full Tutorial: https://www.youtube.com/watch?v=l7Xd8mkqWfc&t=268s
// Output an array as a string separated with the argument's contents.
myArray.join(", ")
// Outputs a string with elements separated by commas.
myArray.toString()
@animoplex
animoplex / EnhancedYouTubeEmbed.html
Created Mar 24, 2019
Enhanced YouTube Embed Code - Animoplex
View EnhancedYouTubeEmbed.html
<!-- Enhanced Youtube Embed Code for Motion Portfolios - Created by Animoplex
Features: Responsive-width player, removes tracking cookies, changes red controls to white, reduces YouTube branding
How to use: Replace the standard YouTube iframe embed code with the code below and add your YouTube video ID -->
<div style="width:100%; max-width:960px;">
<div style="position:relative; height:0; padding-bottom:56.25%;">
<!-- Video size ratio calculation: 1080px / 1920px = 0.5625 (16:9) -->
<iframe
style="position:absolute; width:100%; height:100%;"
src="https://www.youtube-nocookie.com/embed/YOUTUBEVIDEO?autoplay=1&amp;color=white&amp;modestbranding=1&amp;rel=0"
@animoplex
animoplex / MarkerSyncExpression.jsx
Last active Aug 22, 2022
Marker Sync - After Effects Expression by Animoplex
View MarkerSyncExpression.jsx
// Marker Sync Expression
// Modified expression based on Dan Ebbert's Marker Sync Expression
// Original Version: http://www.motionscript.com/design-guide/marker-sync.html
// Full Tutorial: https://www.youtube.com/watch?v=B_3XS2-VWOM&t=698s
src = comp(name).layer("Markers");
n = 0;
if (marker.numKeys > 0) {
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) {
@animoplex
animoplex / DelayedOffset.jsx
Last active Aug 22, 2022
Delayed Offset - After Effects Expression by Animoplex
View DelayedOffset.jsx
// Delayed Offset - Created by Animoplex: www.animoplex.com
// Delays an animation based on the layer above and the frames to delay.
// NOTE: Looks for an identical transform property on the layer above.
// NOTE: To change, replace "transform(thisProperty.name)" with your desired effect.
delay = 10; // Frames To Delay
above = thisComp.layer(index - 1).transform(thisProperty.name);
above.valueAtTime(time - framesToTime(delay))
@animoplex
animoplex / PseudoEffectXML.xml
Last active Aug 22, 2022
Pseudo Effect Via XML - After Effects Example XML by Animoplex
View PseudoEffectXML.xml
// Pseudo Effect Via XML - Example File
// Full Tutorial: https://www.youtube.com/watch?v=pHwBOFZgKcs&t=296s
// Edit the PresetEffects.xml for your version of After Effects to add Pseudo Effects.
// XML File Location on Windows:
// Program Files > Adobe > After Effects (Version) > Support Files
// XML File Location on OSX:
// Apps > After Effects > Right-click After Effects.app > “Show Contents” > Contents > Resources
@animoplex
animoplex / EvaluateTextLayer.jsx
Last active Aug 22, 2022
Evaluate Text Layer - After Effects Expression by Animoplex
View EvaluateTextLayer.jsx
// 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);