// timeRemappingvar src = thisLayer.source;var txt = thisComp.layer("file").text.sourceText.toLowerCase();// loop matchfor (i = 1; i < src.numLayers; i++) {if (src.layer(i).name.toLowerCase().match(txt)) {myLayer = src.layer(i);break;} else {9999 // catch error}}inP = myLayer.inPoint;outP = myLayer.outPoint-framesToTime(0);dur = outP - inP;linear(time,inPoint,dur,inP,outP)
//timeRemapframesToTime(effect("frameSelect")("Slider"));// SlidercontrolmyComp = thisLayer.source;ext = ""//.pngtxt = thisComp.layer("lastName").text.sourceText.toLowerCase();// loop matchfor (i = 1; i < myComp.numLayers; i++) {if (myComp.layer(i).name.toLowerCase().match(txt)) {i-1 // -1 as time starts from 0 ;break;} else {100 // catch error}}
t = timeToFrames(time);t = clamp(t,1,index-1);thisComp.layer(t+1).name;
Parameters:
Layer can be aligned in x-axis with adjustable even space in-between
For that to happen, the anchor points of the layers must be centered
This prevents inconsistent opacity for the layers on both sides
If a layer scale changes, the spacing should change accordingly
Create a control that just change the active "tile";
//POSITION// VARIABLESspace = 0;dir = 1; // 1 for tile right, -1 to tile leftaxisX = 1; // 1 to turn on, 0 to turn offaxisY = 0; //1 to turn on, 0 to turn off// SETUPtarget = thisComp.layer(index + dir)tpos = target.transform.position;tscale = target.transform.scale[0] / 100;tSrc = thisComp.layer(index + dir).sourceRectAtTime().width / 2 * tscaletSrcY = thisComp.layer(index + dir).sourceRectAtTime().height / 2 * tscales = sourceRectAtTime();activeWidth = s.width / 2 * transform.scale[0] / 100activeHeight = s.height / 2 * transform.scale[0] / 100// EXECUTION: Center position to left of target layer, offset the width, + spacingtpos += [(activeWidth + tSrc + space) * axisX, (activeHeight + tSrcY + space) * axisY] * dir;// OPACITYminOpacity = 0;maxDist = thisComp.width/2;v = transform.position[0] // Get x positiond = Math.abs(length(v, thisComp.width / 2)); // Get distance between layersease(d, 0, maxDist, 100, minOpacity)
// VARIABLEspace = thisComp.layer("CONTROL").effect("step")("Slider");center = thisComp.layer("Center");// SETUPdir = -1; // Direction for Rightif (index < center.index) {dir = 1;} // Direction Left if below Center Layertarget = thisComp.layer(index + dir)tpos = target.transform.position;tscale = target.transform.scale[0] / 100;tSrc = thisComp.layer(index + dir).sourceRectAtTime().width / 2 * tscales = sourceRectAtTime();activeWidth = s.width / 2 * transform.scale[0] / 100// EXECUTEtpos += [tSrc * dir, 0]; // // Center position to left of target layertpos += [activeWidth * dir, 0] //// Offset the widthtpos += [space * dir, 0] //add spacing
// null layer "controls"// 1. Create 2 layer controls and select text layers;// 2. Create 3 point controls: "heightWidth","heightWidthWithPad", "padding"// "heightWidth" point control expressiont = effect("Layer Control")("Layer").sourceRectAtTime();t2 = effect("Layer Control 2")("Layer").sourceRectAtTime(time - 1);y = 50; // height of textboxt.width < t2.width ? [t2.width, y] : [t.width, y]// "heightWidthWithPad" point control expressioneffect("heightWidth")("Point") + effect("padding")("Point")// Rectangle shape layer "textbox"// SIZEthisComp.layer("controls").effect("heightWidthWithPad")("Point")// LAYER ANCHOR POINTs = sourceRectAtTime();[s.left,s.top] // left align[s.width/2,0]; // right align,right align your text layers in the paragraph panel & reposition everything as needed.// Line 1 text justification//Put a "Tracking" parameter text animator onto your text layer with this expressionpadding = thisComp.layer("controls").effect("padding")("Point")[0];numChar = text.sourceText.length;padding/numChar;// This will justify your line 1 to the textbox, provided that line 2 is shorter