Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Responsive Mask Not Cooperating. Help Needed.

  • Responsive Mask Not Cooperating. Help Needed.

    Posted by Brayden Blythe on April 5, 2024 at 5:02 pm

    I am trying to make a responsive mask that dynamically wraps around the shape of my text layer. I watched Ukramedia’s tutorial on it which got me almost all the way there. The bug I keep running into is when I slide the layer around in time, the mask will move when it is not supposed to and remain in the wrong position.

    You can see in the screenshot below that the mask is not aligned to the text at the markerTime. There is no error in the expression, it just does not seem to be working. Any help here? I need the shape to be based on the markerTime. Attaching the expression for reference.

    var markerTime = thisLayer.marker.key(1).time;

    var {height, width, left, top} = sourceRectAtTime(markerTime);

    var origin = [left, top]

    var topL = [0, 0];

    var topR = [width, 0];

    var bttmR = [width, height];

    var bttmL = [0, height];

    var pathPoints = [topL, topR, bttmR, bttmL];

    var pathPointsUpdated = [];

    pathPoints.forEach(item => pathPointsUpdated.push(item + [left, top]))

    createPath(pathPointsUpdated);

    Andrei Popa replied 9 months, 3 weeks ago 3 Members · 2 Replies
  • 2 Replies
  • Alan Balch

    April 5, 2024 at 5:08 pm

    Have you tried parenting your text layer to your mask? Parenting is a super useful tool that often that gets overlooked.

  • Andrei Popa

    May 22, 2024 at 9:43 am

    Hi Brayden.

    In case you did not solve this yet, try to change your second line to

    var {height, width, left, top} = sourceRectAtTime(sourceTime(markerTime));

    You have probably moved your layer and the sourceRectAtTime function calculates the time based on your layer time, not the composition time.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy