Skip to main content
after effectsafter effects tutorialstutorials

Easily Reposition Animated Masks With This Ae Expression

By October 20, 2017No Comments

Mikey Borup Shows Another Use for the New After Effects Point Access, Using an Expression to Reposition Keyframed Masks Easily

The newest version of After Effects bestowed a long-awaited and highly sought after feature: The ability to control mask and shape anchor points with expressions. This already has opened up a huge new world to scriptures and novice Ae users alike.

Mikey Borup has been offering some insights not using expression access to mask and shape points. This time, Borup shows a really helpful example for how it can be used in an everyday workflow.

Have you ever wanted to move or reposition an already animated mask? It’s not an easy task, but there are some tricks to do it. How about using the mask tracker and then wanting to adjust only a few frames? Borup shows how you can handle this with the new expression access to mask and shape points, while still keeping the original animation keyframes.

The expression looks like this (just paste it onto the path that you tracked):

[syntax type=”css”]

//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)

[/syntax]
lesterbanks

3D, VFX, design, and typography. Twenty year veteran instructor in all things computer graphics.