Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Parenting to a nested layer that loops!

  • Parenting to a nested layer that loops!

    Posted by Stephen Roberts on July 11, 2014 at 3:50 pm

    Hi Guys!

    Dan Ebberts explained how to parent to a layer within a comp:

    L = comp(“nestedComp”).layer(“layerWithinComp”);
    L.toComp(L.anchorPoint)

    But my problem is that that comp is looping.

    It’s a walk cycle that lasts 1 second. It loops in the main comp. I want to add random blinking eyes that follow it.

    Any thoughts?

    L = comp("nestedComp").layer("layerWithinComp");
    L.toComp(L.anchorPoint)

    Stephen Roberts replied 11 years, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    July 11, 2014 at 4:46 pm

    Are you doing the looping by using a loopOut() expression on a time-remapped nestedComp layer?

    If so, I’d try replacing the loopOut() with a DIY version like this:

    time%key(2).time

    (you make need to adjust this, depending on how you have things set up)

    and then use a similar time calculation to position the other layer in the outer comp:

    t = time%thisComp.layer(“nestedComp”).timeRemap.key(2).time;
    L = comp(“nestedComp”).layer(“layerWithinComp”);
    L.toComp([0,0],t)

    Dan

  • Stephen Roberts

    July 11, 2014 at 4:54 pm

    Wow! that works with no adjustments! Thanks much.

    Of course, now I need to pick this apart and figure WHY it worked.

    Thanks again!
    Stephen

  • Dan Ebberts

    July 11, 2014 at 5:06 pm

    I did forget to change one thing back from my test version to match your version:

    L.toComp([0,0],t)

    should have been

    L.toComp(L.anchorPoint,t)

    Dan

  • Stephen Roberts

    July 11, 2014 at 5:08 pm

    thanks again!

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