Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions loop expression for walk cycle

  • loop expression for walk cycle

    Posted by Scott Gaskin on June 7, 2014 at 6:45 pm

    Hi there,

    I have created a character and animated him doing a walk cycle and want to loop this walk cycle.

    I have always used the ‘loopOut(“cycle”)’ expression successfully before but as I have created his legs using shape layers and animated the paths for the walk I am getting an error message and it won’t allow me to use this expression.

    Is there any other way of looping shape layer paths?

    Thanks in advance

    Scott

    Scott Gaskin replied 11 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Filip Vandueren

    June 7, 2014 at 6:58 pm

    This works!

    if (numKeys) {
    kF=key(1).time;
    kL=key(numKeys).time;
    t=kF+((time-kF)%(kL-kF));
    valueAtTime(t)
    } else {
    value;
    }

  • Scott Gaskin

    June 7, 2014 at 7:57 pm

    Dude your a star!! I love you! 🙂

    Thanks for the quick response man, really appreciated.

    Is there a website you can recommend I can learn more about these in regards to difference between shape layer expressions and others?

    Scott

  • Filip Vandueren

    June 7, 2014 at 8:32 pm

    Long story short: There are a few (not many) types of keyframes that are “special”.
    Shapes, Masks, Curve- and Levels-histograms come to mind.

    They usually can’t easily be expressed as a few numbers (where as position, rotation, colour, etc. can be easily expressed as a collection of 1-4 numbers)
    That’s why not all expressions work on these.

    Actually, I was thinking this solution itself wouldn’t work.
    It’s kind of strange that loopOut doesn’t work if you can ask for a valueAtTime().
    Maybe because while “cycle” and “pingpong” modes would work, there’s not really a straightforward way to define “offset” on a looping mask shape.

    So I would just look out to the usual expression websites, and keep in mind what I said above: every so often you find a property whose keyframes are special.

  • Scott Gaskin

    June 8, 2014 at 10:04 pm

    Thanks for the info dude! Really appreciated
    Scott

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