Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Depth ripple with action script (following Null object)

  • Depth ripple with action script (following Null object)

    Posted by Lamar Daughma on August 29, 2015 at 12:39 am

    ok, so i have a logo comprised of 27 segments and i have music i have synced to soundkeys. now i want a ripple effect following the Z Axis (forward and back, just in case im wrong) so as the layers are further out they go backwards and seeing as i dont want to affect the x,y axis i decided the best option would be a null object. can someone help with this please. i am new to Action script and dont really know the syntax, although in not new to coding so it shouldent be too hard to learn but if im very honest im lost and have no idea what to do, i went in too deep as it were xD.

    any help with this would be appreciated.

    Lamar Daughma replied 10 years, 8 months ago 3 Members · 14 Replies
  • 14 Replies
  • Kalleheikki Kannisto

    August 29, 2015 at 9:31 am

    Checking that I understand correctly: you have the null object already linked to Soundkeys output, and you have 27 different AE 3D layers would like to move with the null, but each with an increasing delay as the z-distance increases so that the motion will “ripple” through the layers? And the motion is also along the z-axis, so that the layers move back and forth to the sound of the beat (at the frontmost layer) and as a ripple through the rest?

    1) If there was no delay, it would be extremely easy: you would type “value + ” and pick-whip the null position, and do this for each layer’s position expression

    2) Since you (I assume) want a delay for each layer so it looks like a ripple, you will have to offset the action in time. There is a method called valueAtTime that helps you to do that. And since every layer has it’s own index number, counting from the top layer down, you can use that to tell how much to offset the time for each layer.

    It that seems like what you’re after, I’ll write and test the code and add it here.

  • Lamar Daughma

    August 29, 2015 at 10:30 am

    exactly what im after. thank you.

  • Kalleheikki Kannisto

    August 29, 2015 at 7:31 pm

    Hi, okay, in that case, this will get you started:

    1) Add a slider control to your null layer.

    2) Add this expression to the position of each layer that you want to have move:

    transform.position+ thisComp.layer("Null 1").transform.position.valueAtTime(time-index/(1+thisComp.layer("Null 1").effect("Slider Control")("Slider")))

    Note that this expression expects that you null is named “Null 1”. If not, change either the name or the expression.

    Use the slider to control how fast the consecutive layers follow the null. (1 = 1 second delay for each layer, 10 = 1/10th second delay, etc.)

    Put the layers you want to move at the very top of the layer stack so that the indices start from 1. (If for some reason that is not possible, deduct the number of layers above the first layer you want to have move from the index number in the expression.)

  • Lamar Daughma

    August 29, 2015 at 7:54 pm

    this is awesome, but i was wondering what if i wanted certain layers to move together?

  • Lamar Daughma

    August 29, 2015 at 9:52 pm

    this is how it is set up at the moment

    (the other nulls have been changed to 3d, but for some reason it didnt show)

    would this work?

  • Lamar Daughma

    August 29, 2015 at 10:04 pm

    I added your code, and i get an error, i took a screen shot.

  • Kalleheikki Kannisto

    August 30, 2015 at 9:07 am

    1) Error is likely due to not having a layer called “Null 1” with a slider Effect named “Slider” on it.

    2) To have some of the layers move together, don’t add an expression to them, but parent them to the layer with an expression that you want them to move with. You should still have the layers that have the expression on them right at the top of the layer stack, and the parented ones below, otherwise you’ll get an extra delay from each in-between layer.

  • Lamar Daughma

    August 30, 2015 at 9:28 am

    ok,
    so i applied it where you said, in the parent and i got it to work but… it moved everything out of place.

  • Lamar Daughma

    August 30, 2015 at 9:55 am

    ok i solved the problem by separating the animation variables so the x,y, & z are separate and changed the variables in the commands to match those of in the actual composion and it works!!! except on every axis BUT the Z axis xD

  • Kalleheikki Kannisto

    August 30, 2015 at 12:38 pm

    Right — I forgot to mention you need to have the null at 0,0,0 as the beginning position, as its position is added to the layer position. You can just move it there.

Page 1 of 2

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