Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions blink within a loop

  • blink within a loop

    Posted by Graham Cross on October 14, 2009 at 3:19 pm

    I’ve googled it, looked at tutorials etc, still can’t get my head around it or get a tutorial to work…

    I’ve got a precomp of an 8 frame walkcycle. On one of it’s layers I’ve got an ‘eye’ precomp consisting of two frames: eyes open and eyes closed.

    I’ve got the walkcycle looping in my main comp, using timeRemap and this simple expression:
    loopOut(type = “cycle”, numKeyframes = 0)

    Now I’d like to make the looping walkcycle precomp tell the eyes precomp (that is inside it) to blink where ever there is a layer marker on the walkcycle precomp – and to make use of the layer markers duration to hold the blink for the same duration.

    anybody know the answer?

    I’m thinking it’s quite simple, but coming from a Actionscript background I’m getting really stuck with Expressions…

    I’d simply do this in Flash: walkcycle_mc.eyes_mc.gotoAndStop(2)

    thanks,

    Graham.
    https://www.feliz.co.uk

    Dan Ebberts replied 16 years, 7 months ago 3 Members · 2 Replies
  • 2 Replies
  • Xinlai Ni

    October 14, 2009 at 5:17 pm

    I would do this inside the eye precomp:
    In the eye precomp, make two layers (EyeOpen and EyeClosed) last long enough (the duration of the walkcycle or main comp). And animate these two layer’s opacity property:
    in one of the layer (e.g., EyeOpen):
    // Find which two markers the current time is in between.
    var markers = comp(“WalkCycle”).layer(“LayerWithMArker”).marker;
    for (i = 1; i <= markers.numKeys + 1; ++i) { if (time < marker.key(i).time) { break; } } (i % 2 == 0) ? 100 : 0 in the other layer ("EyeClosed"), just use 100 - thisComp.layer("EyeOpen).opacity this makes sure when eyeopen is visible, eyeclosed is invisible, vice versa Xinlai Ni Software Engineer, Google Inc.

  • Dan Ebberts

    October 14, 2009 at 7:51 pm

    I think your problem is going to be that the time inside the time-remapped pre-comp never gets beyond your 8-frame loop. You’d need your eyelid to be outside of that comp to be able to detect any markers in the main comp beyond the 8-frame loop.

    Dan

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