Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions drive looping keyframes with rotation slider?

  • drive looping keyframes with rotation slider?

    Posted by Ocean Byrne on February 20, 2012 at 9:58 am

    I know this shouldn’t really be that hard, but I cant quite wrap my head around how to do it.

    Basically I have set up an animation of a moon/star rise, followed by the sun rise, followed by the moon rise again…

    It is fairly complex and has a variety of keyframes going on a wide variety of layers and channels.

    What I want to do now is drive all those different channels with just one rotation slider, so I can loop it over and over, and play with how fast or slow it happens at different points in my final piece.

    So lets say all my animation happens and loops back to the start over 100 frames – how do I tie that to an angle control slider?

    If I then make my angle control take 437 frames to do a rotation, it will smoothly interpolate all my good jazz right, not just chunkily jump every 4ish frames?

    Thanks

    Kevin Camp replied 14 years, 2 months ago 2 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    February 20, 2012 at 9:23 pm

    if you can drop you day/night cycle into a new comp, you could use the angle expression control to drive a time remapping expression like this one:

    loopCtrl=effect(“Angle Control”)(“Angle”);
    linear(loopCtrl%360,0,360,0,key(2).value)

    your day/night cycle would be the equivalent of a 360 degree rotation of the angle control, and timing would be controlled by keyframing that angle control.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Ocean Byrne

    February 20, 2012 at 9:35 pm

    Thanks. I was kind of thinking along those lines, but for one thing, would AE still smoothly interpolate if I strretched beyond the length of precomp? If not I suppose I could make the precomp excessively long, but I’m curious how that works anyhow?

    The other thing though, is I have other layers that I want to be more specific and they are under some looping elements, and over others. I would prefer to keep everything where it is.

    Can I apply the linear() to a range of frames on each channel I want controlled by the angle slider?

    Appreciate the thoughts.

  • Kevin Camp

    February 20, 2012 at 10:28 pm

    the interpolation for any non-rendered items will be fine… interpolation for values between keyframes will scale with time remapping, so that shouldn’t be an issue.

    as for applying the expression to individual properties within the comp, yes you can. currenty the expression looks at an angle control on the same lyaer, but you could put the angle control on any layer and direct the expression to it.

    say you apply the angle control to a null (named ‘Null 1’). then all of the expressions that you wnatd to link to that would have a first line that lookd like this:

    loopCtrl=thisComp.layer(‘Null 1’).effect(“Angle Control”)(“Angle”);

    as for the rest, of the expression, this may work for any keyframed property:

    valueAtTime(linear(loopCtrl%360,0,360,0,key(numKeys).time))

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

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