Activity › Forums › Adobe After Effects Expressions › offsetting mask shape like using loopOut(“offset”)
-
offsetting mask shape like using loopOut(“offset”)
Viktor Aleksandrovsky replied 1 month, 4 weeks ago 6 Members · 14 Replies
-
David Cabestany
January 15, 2014 at 7:35 pmIs there a way to tweak this expression to make it work with a shape layer instead? I tried replacing mask with path and then the name of the path but all I got is the following error:
function “path” is undefined.
What would be the name of the function in a shape layer, then, specifically the path?
Best,
David. -
Dan Ebberts
January 15, 2014 at 7:57 pmIf you’re apply the expression to the shape layer’s path, this should be all you need:
control = effect(“Slider Control”)(“Slider”);
t = key(numKeys).time;
valueAtTime(t*control/100)Dan
-
Viktor Aleksandrovsky
March 8, 2026 at 11:44 am// In AE 2020, to offset path value between two linear keyframes, I use:
var pProp = thisProperty;
if (pProp.numKeys > 1 && time > pProp.key(pProp.numKeys).time) {
var t1 = pProp.key(1).time;
var t2 = pProp.key(pProp.numKeys).time;
var span = t2 – t1;
var n = Math.floor((time – t1) / span); var t = (time – t1) % span;
var pStart = pProp.points(t1); var pEnd = pProp.points(t2);
var pNow = pProp.points(t1 + t);
var newPoints = [];
for (var i = 0; i < pNow.length; i++) {
var dx = (pEnd[i][0] – pStart[i][0]) * n;
var dy = (pEnd[i][1] – pStart[i][1]) * n;
newPoints.push([pNow[i][0] + dx, pNow[i][1] + dy]);
}
createPath(newPoints, pProp.inTangents(t1 + t), pProp.outTangents(t1 + t), pProp.isClosed());
} else {
value;
}
Reply to this Discussion! Login or Sign Up