Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › array[value, value] to control rotation [layer#1, layer#2]

  • array[value, value] to control rotation [layer#1, layer#2]

    Posted by Jouni Kuuva on September 10, 2020 at 10:50 pm

     

    (I actually have 36 graphic objects, but for the sake of simplicity, let’s say that … )

     

    … I have 4 objects, each on their own layer.

    I want to rotate the them to make graphic patterns.

     

    How to make a script that tells layers #1, #2, #3, #4

    to rotate to array values [1], [2], [3], [4], respectively.

     

    So I would have f.ex. these arrays:

    flowerArray = [45, 135, 225, 315];

    boxArray = [0, 90, 0, 90];

     

    How to make this happen (?):

     

    At keyframe 50, rotation is defined by flowerArray:

    Layer#1 rotates to 45°

    Layer#2 rotates to 135°

    Layer#3 rotates to 225°

    Layer#4 rotates to 315°

     

    At keyframe 100, rotation is defined by boxArray:

    Layer#1 rotates to 0°

    Layer#2 rotates to 90°

    Layer#3 rotates to 0°

    Layer#4 rotates to 90°

    Dan Ebberts replied 6 years ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    September 11, 2020 at 4:07 pm

    I’m guessing this isn’t exactly what you’re talking about, but it might give you some ideas:

    flowerArray = [45, 135, 225, 315];

    boxArray = [0, 90, 0, 90];

    startFrame = 50;

    endFrame = 100;

    t1 = framesToTime(startFrame);

    t2 = framesToTime(endFrame);

    linear(time,t1,t2,flowerArray[index-1],boxArray[index-1]);

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