AE Preset – Measurements

There’s been many times where I needed a matching rectangle behind a text layer, or even just need to know a shape layer’s size and center. I got tired of remember the exact usage of the sourceRectAtTime() expression, especially getting the time right. So I made this preset.

Apply conigs_Measurements.ffx to a text or shape layer, and it will give you the Size (width, height), Center (x, y), Top-Left, and Bottom-Right coordinates, with the option for padding. It can get the measurements at the current time, or sample from a set time (maybe for an animated text layer where you want the box to stay static). It also has switches to take into account the scaling of the layer and to give you coordinates in composition space instead of relative to the layer.

Please note this requires AE 13.2 (CC2014) or later as the sourceRectAtTime() expression was first introduced in that version.

What you do with these numbers is up to you, but hopefully this will make it a little easier to rig up elements to another layer’s size.

Measurements is part of the Conigs Mixtape preset pack.

Download Conigs Mixtape today!
  • oscand

    Thanks for sharing.
    I need a clarification I google it and cant find an answer.
    I cant figure out what does mean sourceRectAtTime().top and left?
    It is relative to what?
    Sorry for my english thx in advance for the reply.

    • So Top and Left refer to the top and left sides of the source rectangle of the layer. In the case of this preset, “Top-Left” means the coordinates of that corner.
      These numbers are relative to [0,0] on the layer. this would be the original anchor point for shape and text layers. But changing the anchor point for the layer itself won’t change these numbers. It can definitely be a little confusing.

      • oscand

        It is a little confusing!
        In fact the left value change when I change the paragraph alignment not the anchor point of the layer. The top value doesn’t change.
        THX