Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions One layer to rule them all….

  • One layer to rule them all….

    Posted by Andy Mason on October 8, 2012 at 12:45 pm

    I have a project where I have to transition between a lot of scenes, all the same transition. This client may change their mind about the way the transition should look, and I don’t want to spend days redoing all 40-some of the keyframes by hand.

    I’m wondering if there is a way I can set keyframes on one layer, then use expressions to put the animation from the one layer onto all the other layers. I can do it with expressions, I’m just unable to figure out how to make it occur at different times. Can I use markers to tell the animation when to trigger? How can I do that?

    Dan Ebberts replied 13 years, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    October 8, 2012 at 3:36 pm

    This example (position expression) with follow a master layer’s animation when triggered by its own layer marker. It starts at the master’s first keyframe (does nothing if there are no keyframes):


    P = thisComp.layer("master").transform.position;
    m = marker;
    n = 0;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    t = (n > 0) ? time - m.key(n).time : 0;
    if (P.numKeys > 0)
    P.valueAtTime(P.key(1).time+t)
    else
    value;

    Dan

  • Andy Mason

    October 8, 2012 at 4:20 pm

    Awesome, You are the Maestro.

    So, let’s say I have two markers, one for the transition into the scene and one two go out, or even more markers. How would you designate certain markers to be attached to certain keyframes? Can you identify the markers by name?

  • Andy Mason

    October 8, 2012 at 4:42 pm

    I don’t think I did a very good job explaining that last bit. Say I have the layer that represents the scene I want to have effected by the “master” layer, but I want to have one marker first that would intro the scene, and another later that would transition out of the scene. Would I create a layer for the intro transition, and then another layer for the outro transition? How then would I tell each individual marker which animation it is supposed to play?

    Thank you for the help, it is saving me houuurrsss of work!

  • Dan Ebberts

    October 8, 2012 at 5:48 pm

    That’s a bit more complicated. I think what you want to do is very similar to what I’ve done here:

    https://www.motionscript.com/design-guide/marker-sync.html

    Come back if that doesn’t solve it for you.

    Dan

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