FORUMS: list search recent posts

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

FAQ   •   VIEW ALL
 Need to automate - rotate layer A from 0 to 30 then back to 0 while B is rotating 180 deg. on Nov 19, 2015 at 2:34:09 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.

 Re: Need to automate - rotate layer A from 0 to 30 then back to 0 while B is rotating 180 deg.on Nov 19, 2015 at 5:52:05 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

 Re: Need to automate - rotate layer A from 0 to 30 then back to 0 while B is rotating 180 deg.on Nov 22, 2015 at 9:14:28 amLast Edited By Sasha dal Ponte on Nov 22, 2015 at 9:16:41 am

Thanks Dan!

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