Automation
Spreadsheet to text layers
Section titled “Spreadsheet to text layers”- Refer to CoMotion 2021 title sequence
Spreadsheet to compositions
Section titled “Spreadsheet to compositions”Normalize width of layers
Section titled “Normalize width of layers”nominalValue/width*100nominal = 100offset = 900; // connect to slider controlthreshold = 0;//swidth = thisLayer.sourceRectAtTime().width;svalue = nominal/swidth;*
// conditionalif(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*sNormalizing image/logo sizes based on sampling alpha
Section titled “Normalizing image/logo sizes based on sampling alpha”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 0nominalHeight = 200;topEdge = 0;for (i = 0; i <= height; i++){ temp = sampleImage([width/2,i],[width/2,0.5],true,time); if (temp[3] > 0){ topEdge = i; break; }}bottomEdge = height-1;for (i = height-1; i >= 0; i--){ temp = sampleImage([width/2,i],[width/2,0.5],true,time); if (temp[3] > 0){ bottomEdge = i; break; }}
alphaheight = (bottomEdge-topEdge+1); // in pixelsvalue*nominalHeight/alphaheight*100/value[1]// for logos that are symmetrical//nominal values;n1 = 200;n2 = 400;n3 = 800;
topEdge = 0;for (i = 0; i <= height; i++){ temp = sampleImage([width/2,i],[width/2,0.5],true,time); if (temp[3] > 0){ topEdge = i; break; }}
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; }}=aRatio = leftEdge/topHeight;if(aRatio<1.1){value*n1/leftEfge