Skip to main content
lofloflof
Participating Frequently
Oct 7, 2026 6:49 AM UTC
Open for Voting

sourceRectAtTime() in Comp Space

sourceRectAtTime() is extremely useful, but it only returns values in layer space. Please add a method that returns the bounding rectangle directly in comp space, including all layer transforms (position, scale, rotation, parenting, and collapse transformations where applicable).

This would eliminate complex conversion workarounds and make tasks like responsive layouts, collision detection, alignments, and motion graphics tools much more reliable and performant.

    2 replies

    Community Expert
    Oct 12, 2026 3:54 PM UTC

    sourceRecAtTime() can return the layer's size and position in the composition, including scaled size, if you add calculations for all transforms. I have a bunch of graphics presets that tie background size to text layers, even 3D text layers moving through 3D space. You can combine width, height, scale, top, and even rotation to align a layer in the composition panel with another layer.

    This expression positions a vertical bar shape layer 20 pixels to the left of the source layer no matter where it is in the composition:
     

    src = thisComp.layer("Src Layer");
    srcP = src.position;
    srcT = src.sourceRectAtTime().top;
    srcH = src.sourceRectAtTime().height / 2;
    srcL = src.sourceRectAtTime().left -20;
    [srcP[0] + srcL, srcP[1] + srcT + srcH]

    I could easily throw in a scale[] multiplier to accurately position the layer anywhere in the comp.

    What exactly are you trying to do with your expression? Maybe I could solve the problem.

    Translate
    lofloflof
    lofloflofAuthor
    Participating Frequently
    Oct 16, 2026 10:04 AM UTC

    Hi Rick! Thank you for the proposed solution and and for offering to help
    I am aware that the required values can be calculated and know how to do so. However, I believe it would be beneficial to have a method that directly returns the bounding rectangle in comp space. 

    Translate