🕹️
AE Expressions
  • What is AE Expressions?
  • Getting started with Expressions
    • Useful links
    • After Effects - Quick Expressions Library
  • Quick Tips
    • After Effects - Arm Rig
    • After Effects - Liquid Smear
    • After Effects - Dynamic Shadows
    • After Effects - Dot Display
    • After Effects Expression - Computer Type-on Animation
    • After Effects Expression - Align Elements on a Path
    • After Effects Expression - Inertial Rotation
    • After Effects Expression - Force Field
  • Advanced Projects
  • After Effects - School of Fish
  • After Effects Expression - Global Wind Controller
  • After Effects Expression - Dynamic Line Waves
  • After Effects - Abstract Space Scene
  • After Effects Expression - Connected Dots
Powered by GitBook
On this page

Was this helpful?

After Effects Expression - Dynamic Line Waves

PreviousAfter Effects Expression - Global Wind ControllerNextAfter Effects - Abstract Space Scene

Last updated 4 years ago

Was this helpful?

Full Tutorial:

Apply this code on the LINE's Path:

let amountOfPoints = thisComp.layer("CONTROLS").effect("amount of points")("Slider");
let distanceBetweenLines = thisComp.layer("CONTROLS").effect("distance between lines")("Slider");
let distanceBetweenPoints = thisComp.width/amountOfPoints;
let yInfluence = thisComp.layer("CONTROLS").effect("Y influence")("Slider");

let myPoints = [];

for(i=0; i<=amountOfPoints; i++) {
	
	let tempPoint = fromComp([i*distanceBetweenPoints, (index-1)*distanceBetweenLines]);
	
	let sample = thisComp.layer("ANIMATION").sampleImage(toComp(tempPoint), [1, 1]);
	let sampleHSL = rgbToHsl(sample);
	let posInfluence = linear(sampleHSL[2], 0, 1, yInfluence, -yInfluence);
	
	let newPoint = tempPoint + [0, posInfluence]
	
	myPoints.push(newPoint);
}

createPath(points = myPoints, inTangents = [], outTangents = [], is_closed = false);

/*
Expression by Francisco Giordano, November 2020.
Free for personal use and commercial use.
Instagram @ae.fran.giodano - frangiordano96@gmail.com
*/