Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Is it possible to LoopOut("cycle") if the layer already has an expression? How?

Tagged: 

  • Is it possible to LoopOut("cycle") if the layer already has an expression? How?

    Posted by Ryan Hauser on May 20, 2021 at 4:10 pm

    As the title asks. I am animating a character riding a bike, and everything is driven by the pedal. As the pedal rotates about it’s axle, it has an expression inverting it’s rotation relative to it’s parent so it stays straight up. On top of that expression, there’s a few small adjustment keyframes so the character’s foot doesn’t stick out of their pants in strange ways. So, I need to loop the minor adjustment keyframes whilst keeping the pedal inverted to the root. Simply adding “LoopOut(“cycle”) to the beginning or end of the expression doesn’t seem to work, it is either ignored completely or overridden by the other expression.

    r = transform.rotation + (thisComp.layer(“Pedal Root”).transform.rotation * -1);
    [r]

    Kevin Camp replied 4 years, 12 months ago 2 Members · 4 Replies
  • 4 Replies
  • Kevin Camp

    May 20, 2021 at 4:14 pm

    I think you could just use loopOut() on the ‘pedal root’ layer’s rotation… since your expression is looking at that layer’s rotation it should work.

    — edit —

    sorry, there would still be an issue with the layer’s rotation… we can still make it work, let me take a look.

  • Kevin Camp

    May 20, 2021 at 4:23 pm

    Assuming that the key framed animation on the foot layer’s rotation loops, this should do it:

    r = transform.rotation.valueAtTime(time % key(numKeys).time) + (thisComp.layer("Pedal Root").transform.rotation * -1);
    r
  • Ryan Hauser

    May 20, 2021 at 7:20 pm

    Huh, interesting way to get that to work. I mean, it makes sense!

    I guess the loopOut expressions just don’t play well with others?

  • Kevin Camp

    May 20, 2021 at 7:28 pm

    The loopOut() and loopIn() functions only look at key frame data, neither look at expression data, so you kind of have to roll your own loop function to work with the rest of the expression.

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