Monday 14 October 2013

After Effects stuff

This expression is pasted in map white to- part of tint effect to use index of layer to drive how dark something is, using linear function.
takes index, sees where it is within range of 1->number of layers in the comp and remaps it from 1->0, then returns a grayscale colour value. Nice.

x=linear(index,1,thisComp.numLayers,1,0);
[x,x,x,x];


This is pasted in a time remap effect of a layer, referencing the time remap value of the "leadLayer". It grabs the current state at "time", then subtracts the index, multiplied by the time offset variable (linked to a slider elsewhere). Good for delaying multiple layers and things.

thisComp.layer("leadLayer").timeRemap.valueAtTime(time-(index-1)*thisComp.layer("controlLayer").effect("timeOffset")("Slider"));


A more straightforward expression. "value" takes the pre existing value and uses that. We then add the control layer's distance offset value and add it, after multiplying it by the index (for multiple layer purposes)

value+thisComp.layer("controlLayer").effect("distanceOffset")("Point")*(index-1);