Tutorial 97: Improved Single-Layer Track Mattes

Joe Clay | Nov 17, 2017

I received a comment on an old tutorial and realized there is a way to improve upon it now that we have access to mask path points in expressions. The expression below looks at our first position key and uses that to calculate an offset so that the mask that we apply this to stays put. Take note, if you need to tie it to a different key or a differently named mask, you'll need to modify the expression.

If you're a patron with access to my Quiver expressions, it should already be saved in there for you if you want to download a txt file to use with Quiver.

Lock Mask Expression

p = transform.position;
s = transform.scale/100;
offset = p.key(1).value - p.value;
offset = [offset[0] / s[0], offset[1] / s[1]];
pts = mask("Mask 1").maskPath.points();
for(i = 0; i < pts.length; i++)  {
    pts[i] = pts[i] + offset;

Become a Patron

If you'd like to help support Workbench, check out our Patreon page. For $5 a month, you get access to all of the tutorial project files we've made available as well as other monthly projects, rigs, R&D, elements, early product previews, and BTS content not available anywhere else!

Check out our Patreon Today