Setup & Rigs

Photo matching using string matching

//timeRemap
framesToTime(effect("frameSelect")("Slider"));
// Slidercontrol
// setup
myComp = comp('lib_Photo');
ext = ""//.png
txt = thisComp.layer("lastName").text.sourceText.toLowerCase();
// loop match
for (i = 1; i < myComp.numLayers; i++) {
if (myComp.layer(i).name.toLowerCase().match(txt)) {
i-1;
break;
} else {
100
}
}

Text layer as a check

t = timeToFrames(time); t = clamp(t,1,index-1); thisComp.layer(t+1).name;

Layer slider with responsive positioning

Parameters:

  1. Layer can be aligned in x-axis with adjustable even space in-between

    1. For that to happen, the anchor points of the layers must be centered

    2. This prevents inconsistent opacity for the layers on both sides

  2. If a layer scale changes, the spacing should change accordingly

  3. Create a control that just change the active "tile";

Tiling formula

(target.width/2space)(active.width/2)(target.width/2-space)-(active.width/2)
One direction
Two Directions
One direction
//POSITION
// VARIABLES
space = 0;
dir = 1; // 1 for tile right, -1 to tile left
axisX = 1; // 1 to turn on, 0 to turn off
axisY = 0; //1 to turn on, 0 to turn off
// SETUP
target = thisComp.layer(index + dir)
tpos = target.transform.position;
tscale = target.transform.scale[0] / 100;
tSrc = thisComp.layer(index + dir).sourceRectAtTime().width / 2 * tscale
tSrcY = thisComp.layer(index + dir).sourceRectAtTime().height / 2 * tscale
s = sourceRectAtTime();
activeWidth = s.width / 2 * transform.scale[0] / 100
activeHeight = s.height / 2 * transform.scale[0] / 100
// EXECUTION: Center position to left of target layer, offset the width, + spacing
tpos += [(activeWidth + tSrc + space) * axisX, (activeHeight + tSrcY + space) * axisY] * dir;
// OPACITY
minOpacity = 0;
maxDist = thisComp.width/2;
v = transform.position[0] // Get x position
d = Math.abs(length(v, thisComp.width / 2)); // Get distance between layers
ease(d, 0, maxDist, 100, minOpacity)
Two Directions
// VARIABLE
space = thisComp.layer("CONTROL").effect("step")("Slider");
center = thisComp.layer("Center");
// SETUP
dir = -1; // Direction for Right
if (index < center.index) {
dir = 1;
} // Direction Left if below Center Layer
target = thisComp.layer(index + dir)
tpos = target.transform.position;
tscale = target.transform.scale[0] / 100;
tSrc = thisComp.layer(index + dir).sourceRectAtTime().width / 2 * tscale
s = sourceRectAtTime();
activeWidth = s.width / 2 * transform.scale[0] / 100
// EXECUTE
tpos += [tSrc * dir, 0]; // // Center position to left of target layer
tpos += [activeWidth * dir, 0] //// Offset the width
tpos += [space * dir, 0] //add spacing