Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions BOTH In and Out: Looping expressions, combo in/out ?

  • BOTH In and Out: Looping expressions, combo in/out ?

    Posted by Eric Chard on July 9, 2013 at 4:45 pm

    I thought I remembered a variety of the Loop expression that was a combination of LoopIn and LoopOut, in that it would repeat a set of keyframes both BEFORE the first keyframe and AFTER the last keyframe, but it’s not popping up in my searches.

    Does such a thing exist? This would loop a set of keyframes both before and after the keyframe set, IOW, the same as if you duplicated a layer and used LoopIn and LoopOut on on the duplicated layers.

    (Why not do that? Because if you have to change the mask, then you have to repeat those operations AGAIN.)

    ++++++++++++++++
    “Putting the HARM in ‘harmonica’ since 2005.”
    ++++++++++++++++

    Eric Chard replied 12 years, 10 months ago 3 Members · 5 Replies
  • 5 Replies
  • Mitch Mann

    July 9, 2013 at 4:54 pm

    I don’t know how other people have done it, but I just came up with this that works:

    if (time > key(1).time) { loopOut(type = “cycle”, numKeyframes = 0) }
    else { loopIn(type = “cycle”, numKeyframes = 0) }

  • Eric Chard

    July 9, 2013 at 5:05 pm

    Brilliant! Works a treat! Thanks mate!

    ++++++++++++++++
    “Putting the HARM in ‘harmonica’ since 2005.”
    ++++++++++++++++

  • Eric Chard

    July 10, 2013 at 4:59 am

    Hmmm. Issues that have nothing to do with the Expression’s actual functionality, which is perfect (thanks again):

    When I try to save this as a preset, it (of course) saves the keyframes. When I delete the keyframes to try and save without, I get an error from the expression (which needs keyframes), but it DOES save the Expression, BUT when you load the preset it adds a keyframe at the current time.

    I think these are just generic AE preset issues– what I’d like is for the Preset system to ONLY load the expression into the selected channel, as if I’d cut/pasted it there, and to work w/the existing keyframes. Why AE is adding a keyframe, I don’t know.

    I’d happily take the overhead of making sure the channel had keyframes (as the Expression requires keyframes), if it would just/only/simply/solely load the Expression.

    Am I creating the preset incorrectly?

    Thanks!

    ++++++++++++++++
    “Putting the HARM in ‘harmonica’ since 2005.”
    ++++++++++++++++

  • Dan Ebberts

    July 10, 2013 at 7:04 am

    I think you need an expression that will work even if there are no keyframes. Try this:


    if(numKeys > 1){
    if (time > (key(1).time + key(numKeys).time)/2)
    loopOut()
    else
    loopIn();
    }else
    value

    Apply it to a property with no keyframes and save it as a preset. When you apply the preset to a new layer, it shouldn’t generate any keyframes.

    Dan

  • Eric Chard

    July 10, 2013 at 11:33 pm

    That’s a beauty Dan, thank you so much!

    ++++++++++++++++
    “Putting the HARM in ‘harmonica’ since 2005.”
    ++++++++++++++++

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