Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Script to change rotation values of layers as they pass a null on X?

  • Script to change rotation values of layers as they pass a null on X?

    Posted by James Barber on October 30, 2015 at 3:53 pm

    Hi

    I’ve been scouring the internet looking for a solution but just am not enough of an expressions ninja to figure this out.

    I’ve got a row of designed elements that are 3d layers, a bit like a row of text but instead of letters they are specially designed layers. Now I want to set up an expression so they can rotate on the X-axis from lying flat (and invisible) to standing up, as they pass a null object. So they need to start at a specific value (-90º say, then animate up to 0º, then stop rotating).

    Yes, I could keyframe them individually, but I’m trying to build a project that will have these layers changed a lot over time, sometimes with new ones, smaller ones, bigger ones etc, all by different people. So I want an expression relating to a null so it’s pretty locked in no matter what they add in the future, without needing constant retiming and rejigging.

    Anyone know anything that could help?

    Thanks

    James Barber replied 10 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Xavier Gomez

    October 31, 2015 at 12:18 am

    You can try this:

    DX = transform.position[0]-thisComp.layer(“Null 1”).transform.position.value[0];
    ease(DX, -100, +100, -90, 0);

    In this setup, if the layer is moving from left to right, it will start to stand up 100 px before the null, and will be facing the view 100px after.

    Xavier.

  • James Barber

    November 1, 2015 at 10:10 am

    That’s it! Thank you so much! Been playing around with it for a little while to understand it, and it’s brilliant in it’s simplicity.

    This is going to save tons of people tons of time re-keyframing every iteration. First time I’ve actually asked a question on the forum (even though I’ve found tons of answers here over the years). Thanks again!

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