Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GoodBoyNinja/c62cb4a0d46b1eb1c69443e903992819 to your computer and use it in GitHub Desktop.
Save GoodBoyNinja/c62cb4a0d46b1eb1c69443e903992819 to your computer and use it in GitHub Desktop.
When applied to a path property, it recreates the existing path on the top left side of the screen and keeps it there no matter your layer transforms.
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));
newITs.push(thisLayer.fromCompVec(thisIT));
newOTs.push(thisLayer.fromCompVec(thisOT));
}
createPath(points = newPnts, inTangents = newITs, outTangents = newOTs, isClosed = false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment