Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions marker name in the expression

  • marker name in the expression

    Posted by Daniele Zacchi on February 15, 2018 at 1:38 pm

    Hi guys,

    I am trying to make an automatic animation data driven (from layers called “val ++”).

    and then i want to animate this property with the markers time and a simple ease() operator, but it looks that I cant name my markers with a variable…

    what am I doing wrong in this?

    Many Thanks

    Daniele

    n= 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n--;
    }
    };

    prev = n+1;

    next = n+2;
    K1 = String.valueOf(prev);
    K2 = String.valueOf(next);

    Val1 = thisComp.layer("val "+prev).text.sourceText;
    Val2 = thisComp.layer("val "+next).text.sourceText;

    T1 = parseInt(Val1.split(' '));

    T2 = parseInt(Val2.split(' '));

    U = marker.key(K1).time;

    B = marker.key(K2).time;

    TT = ease(time, U, B, T1, T2);

    [TT, TT]

    Andy Diesel replied 3 weeks ago 3 Members · 5 Replies
  • 5 Replies
  • Andrei Popa

    February 15, 2018 at 5:50 pm

    I tried your expression and found 2 flaws to it. It said that K1 is a function and it needed a number on line 22, and got out of reach for either markers or layers. So i modified it a bit. Tell me if it works, or what does’nt work, in case something is wrong. This is what i got
    n= 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n--;
    }
    };

    prev = n;

    next = (n>=marker.numKeys) ? marker.numKeys : (n+1);
    K1 = prev;
    K2 =next;

    Val1 = thisComp.layer("val "+prev.toString()).text.sourceText;
    Val2 = thisComp.layer("val "+next.toString()).text.sourceText;

    T1 = parseInt(Val1.split(' '));

    T2 = parseInt(Val2.split(' '));

    U = marker.key(K1).time;

    B = marker.key(K2).time;

    TT = ease(time, U, B, T1, T2);

    [TT, TT]

    Andrei
    My Envato portfolio.

  • Daniele Zacchi

    February 16, 2018 at 10:36 am

    Wow!
    It works very well.

    Thanks a lot Andrei!

    Daniele

  • Andy Diesel

    September 21, 2024 at 10:34 am

    Hi Andrei,

    I hope you’re doing well! I am Andy Diesel, an experienced After Effects user but new to coding expressions. I found this helpful discussion with Daniele Zacchi about using marker names in expressions.

    I’m working on a project where markers drive animations across layers, synced to an audio track. I’d love to clarify some points about marker usage and automation. Would you be able to offer some guidance?

    Thanks so much!

  • Andrei Popa

    September 21, 2024 at 11:34 am

    Hi Andy,

    I can help as much as time allows me. My personal email is andreipopa191187@gmail.com, you can write me there and we can talk.

    Cheers,

    Andrei

  • Andy Diesel

    September 23, 2024 at 8:51 am

    I greatly appreciate it, Andrei.

    I’ve sent you the details and will hopefully send a fuller post as I complete this learning.

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