Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How do I pull the TIME of the First keyframe from a layer?

  • How do I pull the TIME of the First keyframe from a layer?

    Posted by Jonathan Moxness on July 18, 2017 at 9:00 pm

    I’m creating a fighting-game style health-bar element that moves based on keyframes (input manually) of a Null Slider Control layer. What I want is when said Main Bar moves, a Red Health Bar layer behind it remains stationary for about 30 frames, then fades out to 0 opacity. Then the next time the Main Bar moves, the Red Health Bar (or a duplicate Red Health Bar) is at the Main Bar‘s previous position, remains stationary for about 30 frames, then fades out to 0 opacity, etc. etc.
    I’ve figured out how to get the Red Health Bar‘s opacity keyframes to start in time with the last keyframe of the Slider Control layer using this expression:

    kf = comp(“Working Comp”).layer(“Right Health Bar”).effect(“Slider Control”)(“Slider”);
    tm = kf.key(kf.numKeys).time;
    opacity.valueAtTime(time – tm);

    But I don’t know how to time it with the FIRST keyframe. If I can get that, I figured I could just add an index expression so it goes up incrementally.

    Here’s an example from Street Fighter V of what I’m trying to emulate: https://youtu.be/gTas1o3gz5Y?t=15s

    Thanks in advance for any help!

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Jonathan Moxness replied 8 years, 10 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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