Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Marker keyframe in precomp to slider expression control

  • Marker keyframe in precomp to slider expression control

    Posted by Nathaniel Akin on September 5, 2017 at 3:49 pm

    UPDATE: a little more searching and I find Dan already answered this question! For anyone else looking to do this the answer is here:

    https://forums.creativecow.net/readpost/227/19361

    Original post:
    I’m using Dan Ebberts code for driving animation using markers and it’s working great for me. What I’d like to do though is adapt it to use keyframe values from a slider control to select which marker in the pre comp is played. I’ve been hacking around at the script but can’t get it to work. Any idea on how to fix this?

    My ideal setup would be to have pre comp (ANI) with all animation in it and markers for each chunk of animation (i.e. 1, 2, 3, etc). In the main comp would be a null layer with a slider control that would select which portion of the pre comp is playing back (1,2,3 etc).

    action = comp("ANI").layer ("action");

    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n--;
    }
    }
    if (n == 0){
    0
    }else{
    m = marker.key(n);
    myComment = m.comment;
    t = time - m.time;
    try{ actMarker = action.marker.key(myComment);
    if (action.marker.numKeys > actMarker.index){
    tMax = action.marker.key(actMarker.index + 1).time - actMarker.time;
    }else{
    tMax = action.outPoint - actMarker.time;
    } t = Math.min(t, tMax);
    actMarker.time + t;
    }catch (err){ 0 } }

    -N
    ___________________
    Nathaniel Akin
    https://oxen.tv

    Nathaniel Akin replied 9 years 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