Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions expression to control multiple layer properties

  • expression to control multiple layer properties

    Posted by Eddy Alvarez on September 26, 2011 at 6:56 pm

    i have a project that consists of 30+ text layers which animate using the Y-rotation ratio properties. all these layers contain the same exact keyframes and animate at the same speed but are positioned at different points in the comp since they are timed to audio. The client has been updating the audio and the new audio has different timing all together. so i have to re-adjust all of these layers’ keyframes in order to match the timing again..it can be really be daunting moving all these keyframes back and forth. I wanted to know if there is an expression i can attach to all these layers and have a null control when its time to animate? Perhaps by using a slider control set to 1 to start text layer 1’s animation..then 2 to start layer 2’s animation, etc…

    Eddy Alvarez replied 14 years, 7 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    September 26, 2011 at 7:51 pm

    There are all kinds of ways to do this. If the timing is related to the audio, you could drop a layer marker on the audio layer wherever you wanted an animation to start. Then the rotation expression would look for a marker on the audio layer whose index matches the audio layer’s index, get the time of that marker, subtract it from the current time, and use that result to drive a valueAtTime() statement to re-time the animation (so that it starts at the appropriate marker). Something like that.

    Dan

  • Eddy Alvarez

    September 26, 2011 at 8:19 pm

    actually, the audio is edited outside of after effects from another editor in pro tools. he then sends me the timecodes based on the timing of that sequence…i should’ve been more clear before..sorry.

  • Dan Ebberts

    September 26, 2011 at 8:58 pm

    You could use markers on a null, or keyframes on a slider to essentially do the same thing. If the layers animate in their stacking order (Layer 1 first, etc) then you just need the timing of the markers/keyframes to drive valueAtTime(). If it’s more complicated than that, the expression might have to examine the value of the slider keyframes or the comment of the markers.

    Dan

  • Dan Ebberts

    September 26, 2011 at 9:07 pm

    Here’s a simple example. It assumes the first layer participating (besides the null) is Layer 1, and that the layer’s animation starts at time zero:


    m = thisComp.layer("Null 1").marker;
    t = 0;
    if (m.numKeys >= index)
    t = Math.max(0,time - m.key(index).time);
    valueAtTime(t)

    Dan

  • Eddy Alvarez

    September 29, 2011 at 1:35 pm

    this and the triggering animation with markers tutorial on your site totally resolved this issue for me. thanks dan!

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