Skip to main content
karlab85774177
Known Participant
July 22, 2024
Question

Opposing rotation expression

  • July 22, 2024
  • 1 reply
  • 693 views

Hello I am trying to create a basic butterfly wing animation (top down. And I just want to add an expression to make the left wing rotate in the opposite direction.  and the shadows to basically do the same.

 

I am currently using the following expression. And it's not working. Does anyone have any suggestions?

thisComp.layer("Right Wing").transform.yRotation;

//value *= -1;

This topic has been closed for replies.

1 reply

Community Expert
July 22, 2024

Subtract the rotation of the master wing from the rotation value of the other wing. Put the animated wing layer above the second wing, and this expression will do it.

ref = thisComp.layer(index - 1).rotation;
value - ref

 Or you could put the name of the animated wing in the first line like this: ref = thisComp.layer("Right Wing").rotation;

karlab85774177
Known Participant
July 23, 2024

Thanks so much for the post. Maybe I am doing it wrong, but I am not able to get it to work. I tried both ways. But unsuccessful.

 

 

 

Community Expert
July 23, 2024

When you apply the expression to a 3D layer, you need to make the ref the specific value for that layer. You are using Y, so the expression should be this:

ref = thisComp.layer(index - 1).transform.yRotation;
value - ref

That should fix the problem. If the right wing is above the left, the expression subtracts the Y rotation value from the left Wing layer's Y rotation.