Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Need to automate – rotate layer A from 0 to 30 then back to 0 while B is rotating 180 deg.

  • Need to automate – rotate layer A from 0 to 30 then back to 0 while B is rotating 180 deg.

    Posted by Sasha Dal ponte on November 19, 2015 at 2:34 pm

    Hello!

    I have two layers – A and B.

    Layer A is linked to null and it is rotated from 0 to 180 deg.

    Layer B is linked to layer A and it needs to rotate in a specific way.

    When layer A rotation value is 0, layer B also needs to be 0.
    When layer A rotation value is 45, layer B needs to be 30.
    When layer A is 180, layer B needs to be back to 0.

    That, of course, needs to be smooth, not in jumps.

    So I need expression that would read layer A rotation value and rotate layer B accordingly.

    Sasha Dal ponte replied 10 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 19, 2015 at 5:52 pm

    Something like this should work:


    r = thisComp.layer("Layer A").transform.rotation;
    if (r < 45){
    linear(r,0,45,0,30);
    }else{
    linear(r,45,180,30,0);
    }

    Dan

  • Sasha Dal ponte

    November 22, 2015 at 9:14 am

    Thanks Dan!

    It works perfectly! I just adjusted 45 angle to 90 because I put it in wrong in original post.

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