Skip to main content
Participant
February 4, 2024
Answered

Tracking the top middle of a layer for an expression

  • February 4, 2024
  • 1 reply
  • 172 views

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 has been closed for replies.
Correct answer Dan Ebberts

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
February 4, 2024

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])