Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Attach Scale and Rotation to layer’s In/Out?

  • Attach Scale and Rotation to layer’s In/Out?

    Posted by David O’dwyer on April 16, 2018 at 5:21 pm

    Hi all,
    I couldn’t find anything which matched my query, so hopefully it’s possible!
    I’m working on a Terminator style overlay template, and one of the features of the overlay is that there’s a “red target box” which comes up which is slightly magnified, which the user will be able to track to an item in their source footage (image Face ID tracking, that kind of thing, where what’s in the box is coloured red and magnified).

    The thing is I’d like users to be able to adjust the scale of the layer, but also have the red overlay rotate and scale up a bit like a pop-up panel as an in and out animation, regardless of layer length. All they should need to worry about is the overall scale of the red overlay, and they don’t need to touch any keyframes for the scale up and scale down of the layer at its start and finish, so I’ve created an adjustment layer with the Transform effect, then parented the red overlay layer to the adjustment layer, that way the scale adjustments to the adjustment layer’s Transform effect will change the scale of the Red overlay without affecting its own Scale keyframes…

    Now the crux of my question, is that since each user will want their red overlay tracker to be up for a different length of time depending on the shot they’re using the template on, ideally it would be great if they could just shorten/extend the red overlay layer within the comp’s timeline, and those in and out animations would stick with the changes, so say the first and last 10 frames of the layer…

    So frame 0 of the layer: Scale 0%, Rotation +90
    Frame 10 of the layer: Scale 100%, Rotation 0
    then frame 10 frames from the end of the layer: Scale 100%, Rotation 0
    Last frame of layer: Scale 0%, Rotation +90
    With ease for all values.

    Would greatly appreciate anyone who can provide me with some help, I’d love to be able to make this as simple for the user as possible so they don’t need to go diving into precomps to adjust things.

    Thanks!
    David

    David O’dwyer replied 8 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    April 16, 2018 at 6:11 pm

    Something like this for scale:


    f = 10; // ramp frames
    v1 = [0,0];
    v2 = [100,100];

    d = framesToTime(f);
    if (time < (inPoint+outPoint)/2)
    ease(time,inPoint,inPoint+d,v1,v2)
    else
    ease(time,outPoint-d,outPoint,v2,v1);

    For rotation, change:

    v1 = 90;
    v2 = 0;

    Dan

  • David O’dwyer

    April 16, 2018 at 7:13 pm

    You, sir, are a genius! It works perfectly. Thank you so much 🙂

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