Automation

Spreadsheet to text layers

  • Refer to CoMotion 2021 title sequence

Spreadsheet to compositions

Normalize width of layers

nominalValue/width100nominalValue/width*100
nominal = 100
offset = 900; // connect to slider control
threshold = 0;
//
swidth = thisLayer.sourceRectAtTime().width;
svalue = nominal/swidth;*

// conditional 
if(swidth>threshold){
    [svalue,svalue,svalue]*offset
}
logo=thisLayer.source.layer(thisLayer.source.numLayers);
sHeight=height/logo.height;
sWidth=width/logo.width;
s=Math.min(sHeight,sWidth);
value*s

Normalizing image/logo sizes based on sampling alpha

normalizedScale=value(nominalValue/width)normalizedScale = value*(nominalValue/width)
nominalWidth = 200;
leftEdge = 0;

for (i = 0; i <= width; i++){
  temp = sampleImage([i,height/2],[0.5,height/2],true,time);
  if (temp[3] > 0){
    leftEdge = i;
    break;
  }
}

rightEdge = width-1;

for (i = width-1; i >= 0; i--){
  temp = sampleImage([i,height/2],[0.5,height/2],true,time);
  if (temp[3] > 0){
    rightEdge = i;
    break;
  }
}
value*nominalWidth/(rightEdge-leftEdge+1)
// cacheCompareSamplesPerSecond 0

Expressions comment to prevent calculations on every frame

https://aescripts.com/auto-crop/

Last updated