Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
I'm not sure what's going on here. The usual approach when adding a text animator would be to animate the Range Selectors In or Out properties. You are animating the Animator/Position and Opacity, so there is no difference between that and animating the layer/Transform/Position and Opacity. Unless you are planning to animate the Range Selectors, there is no reason to add Opacity or Position to a text animator.
It would also help us help you if you posted a link to the tutorial you are trying to follow.
You could try removing the reference to the layer marker and the layer marker. I don't see any reason for it at all. Try this expression:
var {height, width, left, top} = sourceRectAtTime();
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);