Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions semi-random rotation expression

  • semi-random rotation expression

    Posted by Simon Robbrecht on August 27, 2007 at 9:02 pm

    Hi,

    I would like the rotation property to alternate between 0 (that is 0 x +0.0) and a random number between 15 and 45 (that is 0 x + 15 and 0 x +45).
    The result should be a series of properties like: 0, 18, 0, 45, 0, 23, 0, 16, 0, etc.

    Does anyone have a tip or something to get me started?

    I ‘m new to expressions so I haven’t got a clue…

    Thanks for your help.

    simon

    Ryan Fannon replied 17 years, 6 months ago 3 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 27, 2007 at 9:29 pm

    Do you want it to change every frame? If so, this should do it:

    minDegrees = 15;
    maxDegrees = 45;

    frame = Math.round(time/thisComp.frameDuration);
    if (frame%2){
    random(minDegrees,maxDegrees)
    }else{
    0
    }

    Dan

  • Ryan Fannon

    November 7, 2008 at 5:42 pm

    How would you make it stop rotating every frame? I’m trying to duplicate multiple layers and have them pick a random rotation between a min and max value.

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