Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Rotation expression

  • Rotation expression

    Posted by Kim Petersen on December 12, 2007 at 12:22 pm

    Hi again,

    I want to be able to control the rotation of several objects (to be part of a transition). I dug up this expression here at the Cow and I tried to convert to rotation, but without any luck. I’m sure you will be able to what’s wrong in an instant 🙂

    I need the layer to rotate in a maximum of 180 degrees.

    Thanks guys.

    Best,
    Kim

    mouse_layer = thisComp.layer(“mouse layer”);
    beginRotation = 0;
    endRotation = 180;
    beginDistance = 200;
    endDistance = 0;
    dis = length(this.position, mouse_layer.position);
    val = ease(dis, beginDistance, endDistance, endRotation, beginRotation);
    [val, val]

    Trent Armstrong replied 18 years, 5 months ago 5 Members · 7 Replies
  • 7 Replies
  • Filip Vandueren

    December 12, 2007 at 2:03 pm

    Just drop the last line: [val,val] is not necessary.
    It would make it a 2-dimensional value like a position or scale.
    But rotation is just a number.

  • Jamie Bradshaw

    December 12, 2007 at 2:07 pm

    Hi Kim.

    Are you using this expression on a rotation property? If so, you need to make sure it returns just one value, as opposed to two.

    So replace:
    [val,val]
    … with just:
    val

    Jamie

  • Kim Petersen

    December 12, 2007 at 2:23 pm

    Hi!

    Yes, I need it on a rotation property. More specific on the Y-axis.

    [Val] would suffice?

    Thanks again!

    /Kim

  • Mike Clasby

    December 12, 2007 at 6:16 pm

    So, Methinks you’re talking a 3D layer?

    If so, put the expression on the Y Rotation stopwatch.

    Like they suggested, just change the last line to:

    val

  • Mike Clasby

    December 12, 2007 at 6:16 pm

    So, Methinks you’re talking a 3D layer?

    If so, put the expression on the Y Rotation stopwatch.

    Like they suggested, just change the last line to:

    val

  • Mike Clasby

    December 12, 2007 at 6:20 pm

    Delete me. I’m caught in account renaming limbo.

  • Trent Armstrong

    December 13, 2007 at 7:05 pm

    Hi!

    Depending on how complicated it needs to be, you might just need to use the pickwhip to link the Y Rotation of all successive layers to the first layer that rotates.

    Trent

    Trent Armstrong – Creative Cow Leader
    https://www.dallasaeug.com

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