Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to move forwards one frame triggered by thisComp.marker object

  • Expression to move forwards one frame triggered by thisComp.marker object

    Posted by James Baron on January 23, 2019 at 1:41 am

    Hi there,

    Im trying to figure out how to apply an expression to a time remap which will advance one frame every time there is a marker in the main comp

    Thanks in advance!

    James Baron replied 7 years, 6 months ago 3 Members · 6 Replies
  • 6 Replies
  • Brian Holzknecht

    January 23, 2019 at 2:32 am

    Here is something I modified from a previous post I found and it seems to do the trick. Not sure if it’s correct, but it appeared to work for me.

    Brian

    skip = framesToTime(1); // frame skip
    m = thisComp.marker;
    begin = 0;

    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (time < m.key(n).time) n--;
    begin = n*skip;
    }
    value + begin

  • James Baron

    January 23, 2019 at 2:50 am

    Thanks for your reply Brian! Im getting an expression error running it on time remap though?

  • Brian Holzknecht

    January 23, 2019 at 3:06 am

    Hmm… that’s weird. What version of after effects are you using? I’m using 2018 and In my test I made a 2nd comp that I’m using as a source with the time remap on.

    I’m not really an expression guy, but i figured I’d try to help while I’m waiting for some assistance on my question. Lol.

    I’m not at my computer or I’d try to troubleshoot it right now. Sorry.

    Brian

  • Dan Ebberts

    January 23, 2019 at 4:13 am

    Something like this should work:


    m = comp("Main Comp").marker;
    n = 0;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    framesToTime(n);

    Dan

  • Brian Holzknecht

    January 23, 2019 at 4:34 am

    Your expression skills are so impressive, the help I tried to provide came from one of your posts to someone else… Clearly I need to learn a ton more on expressions.

    Brian

  • James Baron

    January 23, 2019 at 10:49 pm

    Perfect Dan!! Thanks a lot for your help Dan and Brian

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