This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=thisComp.layer("NullA").toWorld([0,0,0]); | |
b=thisComp.layer("NullB").toWorld([0,0,0]); | |
wh=thisLayer.effect("weight")("Slider"); | |
aW=a*wh; | |
bW=b*(1-wh); | |
aW+bW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s=effect("size")("Slider"); | |
d=degreesToRadians(effect("driver")("Angle")); | |
h=Math.sin(d); | |
v=-Math.cos(d); | |
([h,v]*s)+value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a messy way to calculate a minimum enclosing shape given a set of 2D points. Just replace the "points[0]=.... ;" section with your own selection of points. | |
// The expression uses a Graham scan to find the points on the outer edge of the shape-- utilizing a cross product to find the point with the greatest "left-turn" for the next vertex on the hull. | |
// It's meant to go on a path shape-- either a mask path or a Shape Layer path. | |
function indexOfMin(arr) { // find index of point that has the lowest x-position. | |
if (arr.length === 0) { | |
return -1; | |
} |