Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Start and stop parenting at specific time

  • Start and stop parenting at specific time

    Posted by Naoko Hara on May 17, 2018 at 12:15 pm

    I have an ellipse (Moon) orbiting another ellipse (Sun) and I want the moon to stop parenting at either a specific time or at a layer marker.
    I found the below expression, but struggling to make it work.

    Is there another time based one, or a layer marker based one? Help??

    Thanks,

    pickuptime = 1.15;
    dropofftime = 2;
    layertofollow = thisComp.layer("hook_angle.ai");
    ticker = Math.min(Math.max(pickuptime, time), dropofftime);
    thisComp.layer("hook_angle.ai").transform.position.value_at_time(ticker)

    Dan Ebberts replied 8 years ago 3 Members · 2 Replies
  • 2 Replies
  • Sam Catt

    May 17, 2018 at 12:27 pm

    whats happening when you use that one currently?

  • Dan Ebberts

    May 17, 2018 at 5:58 pm

    It’s hard to tell exactly, but you might be looking for something like this:


    pickuptime = 1.15;
    dropofftime = 2;
    layertofollow = thisComp.layer("hook_angle.ai");
    if (time < pickuptime)
    value
    else if (time < dropofftime)
    value + layertofollow.position - layertofollow.position.valueAtTime(pickuptime)
    else
    value + layertofollow.position.valueAtTime(dropofftime) - layertofollow.position.valueAtTime(pickuptime)

    Dan

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