📂Dumping Ground
Area to drop Expressions, to tidy up at later date
-Linear Wiggle [on/off slider]

s = effect("Slider Control")("Slider");
a = wiggle(5,50);
b = value;linear(s,0,100,a,b);
-Split Layer name
id = thisLayer.name.split(" - ")[1];
-Split Name for Data Entery
id = thisLayer.name.split(" - ")[1];
id2 = thisLayer.name.split(" - ")[2];
footage("table.csv").dataValue([id,id2]);
-Random Color
seedRandom(index,true);
random([0,0,0,1],[1,1,1,1])
-Ignore Parented Scale
s = [];
parentScale = parent.transform.scale.value;
for (i = 0; i < parentScale.length; i++){
s[i] = (parentScale[i]== 0) ? 0 : value[i]*100/parentScale[i];
}
s
-Link Colors
id = thisLayer.name.split(" - ")[1];
comp("Style Sheet").layer("Color Style").effect(id)("ADBE Color Control-0001");
-Link Text Style
var control = Math.floor(effect("Text Style")("Menu"));
switch (control)
{
case 1:
a = comp("Style Sheet").layer("Header").text.sourceText;
a.getStyleAt(0,0);
break;
case 2:
b = comp("Style Sheet").layer("Body").text.sourceText;
b.getStyleAt(0,0);
break;
case 3:
c = comp("Style Sheet").layer("Details").text.sourceText;
c.getStyleAt(0,0);
break;
default:
value;
break;
}
-Box Fits Text
s = parent;
w=s.sourceRectAtTime().width+30
;
h=s.sourceRectAtTime().height+30
;
[w,h]
-Number Counter + Prefix & Suffix
/num = "prefix"+effect("Slider Control")("Slider").value.toFixed(0)+"suffix";
function addCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
addCommas(num);
-PointOnPath
var path = thisComp.layer("Shape Layer 1").content("Shape 1").content("Path 1").path;
var trimPath = thisComp.layer("Shape Layer 1").content("Shape 1").content("Trim Paths 1").end /100;
var targetLayer = thisComp.layer("Shape Layer 1");
var point = path.pointOnPath(trimPath);
targetLayer.toComp(point)+value;
-Track Trim
//Code
var path = thisComp.layer("Shape Layer 1").content("Shape 1").content("Path 1").path;
var trimPath = thisComp.layer("Shape Layer 1").content("Shape 1").content("Trim Paths 1").end /100;
var realOffset = thisComp.layer("Shape Layer 1").content("Shape 1").content("Trim Paths 1").offset
realOffset = realOffset/360
var targetLayer = thisComp.layer("Shape Layer 1");
var point = path.pointOnPath((trimPath /2) + realOffset);
x = targetLayer.toComp(point);
-TITLE
//Code
-TITLE
//Code
-TITLE
//Code
-TITLE
//Code
Last updated