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 clip on timeline

  • Expression to move clip on timeline

    Posted by Asher Eggleston on October 31, 2022 at 7:24 pm

    Hi,

    I’m using markers to trigger animations in an after effects project. But I’m not sure how to align the beginning of a comp to specific locations on the timeline. Does anyone know if there is an expression to move a clip the variable “time”?


    Thanks,

    Asher Eggleston replied 3 years, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    October 31, 2022 at 7:26 pm

    Expressions can’t move a clip, but if you turn on time remapping for the clip, a time remapping expression can determine when it plays.

  • Asher Eggleston

    October 31, 2022 at 7:30 pm

    I thought that might be the case but figured I’d ask. I’ll look up time remapping.

  • Dan Ebberts

    October 31, 2022 at 7:39 pm

    For example, this simple time remapping expression will hold a clip at frame 0 until the clip’s first marker is reached. The clip then plays from the marker onward.

    t = 0;
    if (marker.numKeys > 0){
    t = time - marker.key(1).time;
    }
  • Asher Eggleston

    October 31, 2022 at 9:02 pm

    In case anyone else comes across this, here is the code I wrote to use a Marker to control the Time Remap. This marker is on the layer you want to adjust but you could also link this to any marker in a project.

    var mark = thisLayer.marker.key(1).time; //Marker location
    var begin = 0; //Start point of your clip
    var dur = 1.2; //Clip duration in seconds
    linear(time, mark, mark+dur, startTime, dur);

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