Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using current time with expressions

  • Using current time with expressions

    Posted by Matt Howarth on August 2, 2020 at 8:37 pm

    Hi all

    I’m attempting to trigger a sequence playback using sample image. I can drive the sequence directly with the colour that is currently under it frame by frame (ie if it’s black it’s frame 0, mid grey is half way, white is the last frame etc.) But I would like to trigger the playback from the beginning, at the correct frame rate when a certain value is under it on the control layer.

    So I wrote an if else statement that triggers playback by adding the timeremap value to time,but obviously that makes the video sequence jump to that frame (if it’s triggered at frame 50, it jumps to frame 50 of the sequence).

    So, my question is, can I get the current time value when the correct colour is detected, so I can subtract it from the timeremap value figure, before adding it to time?

    Did that make sense? Apologies if not ?

    Or is there a better way to trigger video playback with an image value?

    Thanks

    Matt

    Visual tinkerer and easily distracted admirer of all things shiny! – writer – animator – digital artist

    Matt Howarth replied 5 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 3, 2020 at 12:29 am

    The problem is that expressions have no memory, so you can’t keep track of when an event like that happens. What you could do is check if the sampleImage() result is currently above the threshold, and if so, then you can have the the expression go backwards in time, frame by frame, (using sampleImage’s time parameter) to find the frame where the value went from below the threshold to above the threshold. From that you can calculate how long ago that happened, and how far you should be into the time remapping. Tricky, but do-able.

    Dan

  • Matt Howarth

    August 3, 2020 at 6:55 pm

    Hi Dan

    many thanks for the super prompt response as ever.

    Wow, it seems very computationally expensive, especially if we have a number of these objects triggering and a long comp duration.

    I will have a play and see if my machine explodes : )

    many thanks for the info.

    cheers

    Matt

    Visual tinkerer and easily distracted admirer of all things shiny! – writer – animator – digital artist

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