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
// USER SETTINGS | |
cornerRadius = undefined; // leave undefined to use comp size average; | |
topLeftCorner = undefined; // leave undefined to use comp zero point [0,0]; | |
btmRightCorner = undefined; // leave undefined to use comp size point [compWidth,compHeight]; | |
// EXPRESSION | |
function FindCirclePnt(cornerPnt, cornerRadius, angleFromCornerToCircle) { | |
circlePntX = cornerRadius * Math.cos(degreesToRadians(angleFromCornerToCircle)); | |
circlePntY = cornerRadius * Math.sin(degreesToRadians(angleFromCornerToCircle)); |
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
function AccelDeccel(point) { | |
xResult = ""; | |
yResult = ""; | |
pointVelocity = point.velocity; | |
pointVelocityLastFrame = point.velocityAtTime(time - thisComp.frameDuration); | |
xVelocityNow = Math.abs(pointVelocity[0]); | |
yVelocityNow = Math.abs(pointVelocity[1]); | |
xVelocityLastFrame = Math.abs(pointVelocityLastFrame[0]); | |
yVelocityLastFrame = Math.abs(pointVelocityLastFrame[1]); |
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
function MoveAlongEdgesOfComp(percent, marginpercent) { | |
percent = (percent === undefined) ? 0 : percent % 100; | |
marginpercent = (marginpercent === undefined) ? 0 : clamp(marginpercent, 0, 100); | |
// convert the original percent value to both horizontal and vertical percent values to drive the motion | |
horizontalpercent = (percent >= 25 && percent <= 50) ? 100 : (percent >= 75 && percent <= 100) ? 0 : (percent < 25) ? (percent * 4) : (100 - (4 * (percent % 25))); | |
verticalpercent = (percent >= 0 && percent <= 25) ? 0 : (percent >= 50 && percent <= 75) ? 100 : (percent < 50) ? (percent - 25) * 4 : (100 - (4 * (percent % 25))); | |
midPoint = [thisComp.width * 0.5, thisComp.height * 0.5]; // use the linear function to drive each dimension | |
xLoc = linear(horizontalpercent, 0, 100, 0, thisComp.width); |
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
function CircularMotion (theRadius, degrees, angleShift){ | |
degrees = (degrees === undefined) ? - 90 : -degrees + 90 | |
angleShift = (angleShift === undefined) ? 0 : -angleShift; | |
theRadius = (theRadius === undefined) ? 100 : theRadius; | |
xDir = Math.sin(degreesToRadians(degrees + angleShift)); | |
yDir = Math.cos(degreesToRadians(degrees + angleShift)); | |
return [xDir * theRadius, yDir * theRadius] + 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
function SquareMotion(squareSize, percent) { | |
squareSize = (squareSize === undefined) ? 100 : squareSize; | |
percent = (percent === undefined) ? 0 : percent % 100; | |
sideSize = squareSize / Math.SQRT2; | |
halfSize = sideSize * 0.5; | |
perimeter = sideSize * 4; // convert the original percent value to both horizontal and vertical percent values to drive the motion | |
horizontalpercent = (percent >= 25 && percent <= 50) ? 100 : (percent >= 75 && percent <= 100) ? 0 : (percent < 25) ? (percent * 4) : (100 - (4 * (percent % 25))); | |
verticalpercent = (percent >= 0 && percent <= 25) ? 0 : (percent >= 50 && percent <= 75) ? 100 : (percent < 50) ? (percent - 25) * 4 : (100 - (4 * (percent % 25))); // use the linear function to drive each dimension | |
xLoc = linear(horizontalpercent, 0, 100, -halfSize, halfSize); |
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
srcPath = thisProperty; | |
newPnts = []; | |
newITs = []; | |
newOTs = []; | |
for (i = 0; i < srcPath.points().length; i++) { | |
thisPoint = srcPath.points()[i]; | |
thisIT = srcPath.inTangents()[i]; | |
thisOT = srcPath.outTangents()[i]; | |
newPnts.push(thisLayer.fromComp(thisPoint)); |
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
function isMacOS(){ | |
var currentSystemOS = String($.os).toLowerCase(); | |
if (currentSystemOS.indexOf("mac") == -1) { | |
return false | |
} else { | |
return true; | |
} | |
} | |
isMacOS(); |
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
(function(thisObj) { | |
// Any code you write here will execute before the panel is built. | |
buildUI(thisObj); // Calling the function to build the panel | |
| |
function buildUI(thisObj) { |
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
function LayerParentOfProperty(property) { | |
try { | |
return property.propertyGroup(property.propertyDepth); | |
} catch (e) { | |
return property; | |
} | |
} | |
// example of use, gets the first selected property. | |
var selectedProperty = app.project.activeItem.selectedProperties[0]; |
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
function AllEffectsOnLayer(layer) { | |
if (layer !== undefined) { | |
// alert ("shit") | |
var effectsGroup = layer("ADBE Effect Parade"); | |
//var effectsOnLayer = new Array(); |
NewerOlder