Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects expression using markers to animate position not working

  • expression using markers to animate position not working

    Posted by Mel Ruiz on August 8, 2018 at 8:29 pm

    I’m trying to have the position of a shape follow a null between two markers on a marker layer. (So, I have a shape layer, a null for movement and another null with markers on it.

    I used the expression below for the position of my shape layer, but even though this position:
    thisComp.layer(“ball control”).transform.position.valueAtTime(endTime)
    isn’t changing after the endTime, the shape moves once the null object moves after that time.

    Any idea what’s happening? Thanks so much!

    beginTime = thisComp.layer(“MARKERS”).marker.key(“beginTime1”).time;
    endTime = thisComp.layer(“MARKERS”).marker.key(“endTime1”).time;

    if (time < beginTime)
    thisComp.layer(“ball control”).transform.position.valueAtTime(beginTime)
    else if (beginTime <= time < endTime)
    thisComp.layer(“ball control”).transform.position
    else
    thisComp.layer(“ball control”).transform.position.valueAtTime(endTime)

    Mel Ruiz replied 7 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kalleheikki Kannisto

    August 9, 2018 at 12:43 pm

    Modify you “else if” like this

    else if (beginTime <= time && time < endTime)

    As I understand it, only the first part of the else if comparison (beginTime<=time) was evaluated the way you had it written. Kalleheikki Kannisto Senior Graphic Designer

  • Mel Ruiz

    August 9, 2018 at 3:47 pm

    worked! thanks. : )

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