Animated video grid in After Effects | SampleImage expression tutorial
It will be quite hard for weak computers, so be patient, even I have problems with the preview, but it renders pretty fast. I hope you enjoy this video!
If you know what I can improve in my videos, please leave a comment 🙏
My Instagram:
Position expression:
// Setting parameters
shapeCompWidth = 50; // Shape composition width
compWidth = 1000; // Main composition width
// Calculate the number of items per row
itemsPerRow = (compWidth / shapeCompWidth); // Calculate how many items fit in one row based on the composition width and spacing
// Calculate the position
x = (index - 1) % itemsPerRow * shapeCompWidth; // Calculate the x position using the index, spacing, and number of items per row
y = ((index - 1) / itemsPerRow) * shapeCompWidth; // Calculate the y position using the index, spacing, and number of items per row
[x, y] // Return the calculated position as an array
Time-remap expression:
// Define the target layer
target = (“Footage“);
// Position for sampling the value
samplePoint = [[0], [1]];
// Sampling size
sampleSize = [1, 1];
// Get the value from the target layer
sample = (samplePoint, sampleSize);
// Convert the value for use in time remap
// Assuming we’re using the red channel (sample[0])
timeRemapValue = sample[0] * * 100; // Example scaling
// Return the value for time remap
timeRemapValue