Skip to content

Instantly share code, notes, and snippets.

Created October 18, 2017 23:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/c3b4591c11cc9fc12d4bdf36b931940f to your computer and use it in GitHub Desktop.
Save anonymous/c3b4591c11cc9fc12d4bdf36b931940f to your computer and use it in GitHub Desktop.
Mask Track Offset Position expression
//input variables - pickwhip tPath to your path and offsetPos to your null or expression controller
var tPath = mask("Mask 1").maskPath;
var offsetPos=effect("Mask Position Offset")("Point");
var tPoints=[];
var InTan=[];
var OutTan=[];
var mPos=offsetPos-[thisComp.width/2,thisComp.height/2];
var tClosed=tPath.isClosed();
for(i=0;i<(tPath.points().length);i++)
{
tPoints.push([tPath.points()[i][0]+mPos[0],[tPath.points()[i][1]+mPos[1]]],);
InTan.push([tPath.inTangents()[i][0],[tPath.inTangents()[i][1]]],);
OutTan.push([tPath.outTangents()[i][0],[tPath.outTangents()[i][1]]],);
}
createPath(tPoints, InTan, OutTan,tClosed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment