Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Automatically fit a rotated layer to comp dimensions

  • Automatically fit a rotated layer to comp dimensions

    Posted by Joel Bellagamba on September 8, 2017 at 11:03 am

    I have a full screen layer (an animated precomp) that I’d like to allow users to adjust the rotation of, with the scale property being dynamically altered to fill the composition. It doesn’t matter that the scale values aren’t uniform, I just need to make sure there are no gaps.

    For instance, at a rotation value of 45 degrees the layer has to scale up to an arbitrary value of 110,198, so its bounding box fills the comp corners.

    Does anyone know how to connect the scale of a layer to its rotation so it always fills the entire composition? I wonder, also, if would it be easier to calculate if the layer was square (currently 1920×1080).

    https://www.enchanted.media

    Joel Bellagamba replied 8 years, 10 months ago 1 Member · 1 Reply
  • 1 Reply
  • Joel Bellagamba

    September 11, 2017 at 10:29 pm

    Ok, I’ve been through the hoops and can’t find the correct math for this so I’ve animated the layer’s scale manually over 360 frames and am attempting to TimeRemap the frames to a parent comp.

    I do have a new expression request though – which should be an easy one, I hope!

    In my parent comp I have 2 layers. Layer 1 is a pre-composed (child comp) animation of 360 frames which has been time-remapped, and is basically ‘frozen’ at an arbitary value (let’s use frame 60).

    Layer 2 wants to use a scale value from the child comp. That is, I need to retrieve the scale value from a layer that resides within Layer 1, at the time-remapped value of frame 60 (hope I’m making sense!).

    Currently it just retrieves the value at the current frame of the parent/child comp and is ignoring the time-remapping.

    Any help greatly appreciated.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy