Skip to main content
Participant
Feb 4, 2024 4:07 AM UTC
Answered

Tracking the top middle of a layer for an expression

Trying to figure out how I would track the topmost middle of an arbitrarily changing shape layer for use in a expression. Said shape layer changes size to fit the size of a textbox.

This topic is closed to new replies. Start a new post to keep the conversation going.
Dan Ebberts
Dan EbbertsCorrect answer
Community Expert
Feb 4, 2024 5:23 AM UTC

An expression like this maybe:

L = thisComp.layer("Shape Layer 1");
r = L.sourceRectAtTime(time,false);
L.toComp([r.left+r.width/2,r.top])

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
Feb 4, 2024 5:23 AM UTC

An expression like this maybe:

L = thisComp.layer("Shape Layer 1");
r = L.sourceRectAtTime(time,false);
L.toComp([r.left+r.width/2,r.top])
Translate