This media is not supported in your browser
    VIEW IN TELEGRAM
  SourceRectAtTime() + Scale
By the default
  By the default
SourceRectAtTime()do not include Scale property so here is the script that include Scale factor.width = thisComp.layer("blue").sourceRectAtTime().width;
height = thisComp.layer("blue").sourceRectAtTime().height;
thisScalePercentage = thisComp.layer("blue").transform.scale[0] / 100;
widthScale = width * thisScalePercentage;
heightScale = height * thisScalePercentage;
[widthScale, widthScale]This media is not supported in your browser
    VIEW IN TELEGRAM
  Here is a quick tip to lock the object to the center of composition.
Position property:
Anchor point:
Position property:
[thisComp.width/2, thisComp.height/2]Anchor point:
a = thisLayer.sourceRectAtTime(); height = a.height; width = a.width;  top = a.top;  left = a.left; x = left + width/2; y = top + height/2; [x,y];❤1
  This media is not supported in your browser
    VIEW IN TELEGRAM
  Image content fill into mask shape layer
Apply to Scale property
let mask = thisComp.layer("mask");
let imgWidth = thisLayer.sourceRectAtTime().width;
let imgHeight = thisLayer.sourceRectAtTime().height;
let maskScaleX = mask.transform.scale[0] / 100;
let maskScaleY = mask.transform.scale[1] / 100;
let maskWidth = mask.sourceRectAtTime().width * maskScaleX;
let maskHeight = mask.sourceRectAtTime().height * maskScaleY;
let scaleToX = maskWidth / imgWidth * 100;
let scaleToY = maskHeight / imgHeight * 100;
if (scaleToX >= scaleToY) {
scale = scaleToX;
} else if (scaleToY > scaleToX) {
scale = scaleToY;
} [scale, scale]
Apply to Scale property
let mask = thisComp.layer("mask");
let imgWidth = thisLayer.sourceRectAtTime().width;
let imgHeight = thisLayer.sourceRectAtTime().height;
let maskScaleX = mask.transform.scale[0] / 100;
let maskScaleY = mask.transform.scale[1] / 100;
let maskWidth = mask.sourceRectAtTime().width * maskScaleX;
let maskHeight = mask.sourceRectAtTime().height * maskScaleY;
let scaleToX = maskWidth / imgWidth * 100;
let scaleToY = maskHeight / imgHeight * 100;
if (scaleToX >= scaleToY) {
scale = scaleToX;
} else if (scaleToY > scaleToX) {
scale = scaleToY;
} [scale, scale]
❤2👍2
  This media is not supported in your browser
    VIEW IN TELEGRAM
  Parallax animation
The easy to use and customize parallax animation for multiply object. You just need to animate null (or other layer) position, then apply the multiply index value with slider contol for each layer.
Apply to position property:
let nullRefer = thisComp.layer("Null 1");
let multyplyerSlider = effect("index")("Slider");
let xReffer = nullRefer.transform.position[0] * multyplyerSlider;
let yReffer = nullRefer.transform.position[1] * multyplyerSlider;
let thisX = transform.position.value[0];
let thisY = transform.position.value[1];
x = thisX + xReffer;
y = thisY + yReffer;
[x, y]
The easy to use and customize parallax animation for multiply object. You just need to animate null (or other layer) position, then apply the multiply index value with slider contol for each layer.
Apply to position property:
let nullRefer = thisComp.layer("Null 1");
let multyplyerSlider = effect("index")("Slider");
let xReffer = nullRefer.transform.position[0] * multyplyerSlider;
let yReffer = nullRefer.transform.position[1] * multyplyerSlider;
let thisX = transform.position.value[0];
let thisY = transform.position.value[1];
x = thisX + xReffer;
y = thisY + yReffer;
[x, y]
👍1
  This media is not supported in your browser
    VIEW IN TELEGRAM
  Custom variables based animation 🤔
I want to show you very specific trick witch allow you to animate object position of the layer with changeable size. It's allow you to animate objects based on variable(like Width, Height etc.) you have set inside expression and multiply by keyframe values that you set on the timeline. In this example below the keyframe values are set to
  I want to show you very specific trick witch allow you to animate object position of the layer with changeable size. It's allow you to animate objects based on variable(like Width, Height etc.) you have set inside expression and multiply by keyframe values that you set on the timeline. In this example below the keyframe values are set to
-1, 0, 1. The position of the text animate from left side to center and right side does not matter what the length of the text.let xValue = value[0];let yValue = value[1];let xCenter = thisComp.width / 2; let yCenter =  thisComp.height / 2;let layerWidth = thisLayer.sourceRectAtTime().width;let layerHeight = thisLayer.sourceRectAtTime().height;let thisScalePercentage = transform.scale[0]/100;let widthScale = layerWidth * thisScalePercentage;let heightScale = layerHeight * thisScalePercentage;x = (xValue * (thisComp.width + widthScale) / 2) + xCenter;y = (yValue * (thisComp.height + heightScale) / 2) + yCenter;[x , yCenter]This media is not supported in your browser
    VIEW IN TELEGRAM
  Repeater Text animation
1. Create Control layer. With slider control zRotation.
2. Create text layer "Original" that will be main refferance text. Make the text 3D layer
3. Copy text layer tha will reffer to layer "Original". Apply this expression to reffer to the text styles and source text:
4. Apply to the position property:
5. Apply to Orientation property:
6. Dublicate layer with the expression as many times as you need.
Animate with slider control zRotation.
1. Create Control layer. With slider control zRotation.
2. Create text layer "Original" that will be main refferance text. Make the text 3D layer
3. Copy text layer tha will reffer to layer "Original". Apply this expression to reffer to the text styles and source text:
var sourceTextProperty = thisComp.layer("Original").text.sourceText; var newStyle = sourceTextProperty.getStyleAt(0,time);   newStyle.setText(sourceTextProperty);4. Apply to the position property:
let x = thisComp.layer("Original").transform.position[0]; let y = thisComp.layer("Original").transform.position[1]; let z = -index-2; [x, y, z]5. Apply to Orientation property:
let thisIndex = index-2; let zRotation = thisComp.layer("Control").effect("zRotation")("Slider"); let refferZ = thisComp.layer("Original").transform.zRotation; let z = refferZ + thisIndex * zRotation; [0, 0, z]6. Dublicate layer with the expression as many times as you need.
Animate with slider control zRotation.
👍2❤1
  Spiral matrix layer duplicates based on layer index🌀
  var user_id = index;
let margin = 0; //margin
function get_coordinates_from_user_id() {
    var k = Math.ceil((Math.sqrt(user_id) - 1) / 2);
    var t = 2 * k + 1;
    var m = t * t;
    t = t - 1;
    if (user_id >= m - t) {
        return [-k, k - (m - user_id)]
    } else m = m - t;
    if (user_id >= m - t) {
        return [-k + (m - user_id), -k]
    } else m = m - t;
    if (user_id >= m - t) {
        return [k, -k + (m - user_id)]
    };
    return [k - (m - user_id - t), k];
}
get_coordinates_from_user_id(user_id);
let sIndex = get_coordinates_from_user_id(user_id);
let width = thisLayer.sourceRectAtTime().width + margin;
let height = thisLayer.sourceRectAtTime().height + margin;
let thisScalePercentage = thisLayer.transform.scale[0] / 100;
let widthScale = width * thisScalePercentage * sIndex[0];
let heightScale = height * thisScalePercentage * sIndex[1];
[widthScale + value[0], heightScale + value[1]]This media is not supported in your browser
    VIEW IN TELEGRAM
  Quick tip to debug your expression😱
Simply drag and drop property into comp window and AE automaticly create text layer witch shows you the current property value.
  Simply drag and drop property into comp window and AE automaticly create text layer witch shows you the current property value.
This media is not supported in your browser
    VIEW IN TELEGRAM
  Fit (Scale) one layer to another layer Width. and Height
Apply to Scale
Apply to Scale
targetL = thisComp.layer("Reffer Layer");
sourceW = sourceRectAtTime().width;
sourceH = sourceRectAtTime().height;
targetScW = targetL.transform.scale[0] / 100;
targetScH = targetL.transform.scale[1] / 100;
targetW = targetL.sourceRectAtTime().width * targetScW;
targetH = targetL.sourceRectAtTime().height * targetScH;
percentW = (targetW / sourceW * 100);
percentH = (targetH / sourceH * 100);
[percentW, percentH]❤2
  This media is not supported in your browser
    VIEW IN TELEGRAM
  ➿Loop of any property from 
Based on index property
Min to Max value.Based on index property
let ctrl = thisComp.layer("Control"); //control Layer
index = index - ctrl.index;
let count = thisComp.numLayers - ctrl.index;
let proppertyMax = ctrl.effect("Max")("Slider");
let proppertyOffset = ctrl.effect("Offest")("Slider")/100;
let baseProperrty = ctrl.effect("Min")("Slider");
index = index + proppertyOffset;
var reset = 0;
for (var i = 0; i < index; i++) {
  if(i % count) continue;
  reset = i;
}
index = index - reset;
x = linear(index, 0 ,count , 0 , 1);
x = x * proppertyMax + baseProperrty;
[x, x]❤4
  This media is not supported in your browser
    VIEW IN TELEGRAM
  Hi there👋
I'd like to show you my new After Effects Comps and Layers Renamer Script. It allows you to rename selected layers and comps inside the Project panel based on their order. This is one of the first scripts I've created for AE, and it's very simple and easy to use.
Download for Free from Gumroad👈
#script
I'd like to show you my new After Effects Comps and Layers Renamer Script. It allows you to rename selected layers and comps inside the Project panel based on their order. This is one of the first scripts I've created for AE, and it's very simple and easy to use.
Download for Free from Gumroad👈
#script
👍7❤1