ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Depth ripple with action script (following Null object)

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Lamar DaughmaDepth ripple with action script (following Null object)
by on Aug 29, 2015 at 12:39:15 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.


Return to posts index


Kalle KannistoRe: Depth ripple with action script (following Null object)
by on Aug 29, 2015 at 9:31:05 am
Last Edited By Kalle Kannisto on Aug 29, 2015 at 9:31:40 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.


Return to posts index

Lamar DaughmaRe: Depth ripple with action script (following Null object)
by on Aug 29, 2015 at 10:30:39 am

exactly what im after. thank you.


Return to posts index


Kalle KannistoRe: Depth ripple with action script (following Null object)
by on Aug 29, 2015 at 7:31:45 pm
Last Edited By Kalle Kannisto on Aug 29, 2015 at 7:37:49 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.)


Return to posts index

Lamar DaughmaRe: Depth ripple with action script (following Null object)
by on Aug 29, 2015 at 7:54:23 pm

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


Return to posts index

Lamar DaughmaRe: Depth ripple with action script (following Null object)
by on Aug 29, 2015 at 9:52:53 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?


Return to posts index


Lamar DaughmaRe: Depth ripple with action script (following Null object)
by on Aug 29, 2015 at 10:04:41 pm

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


Return to posts index

Kalle KannistoRe: Depth ripple with action script (following Null object)
by on Aug 30, 2015 at 9:07:51 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.


Return to posts index

Lamar DaughmaRe: Depth ripple with action script (following Null object)
by on Aug 30, 2015 at 9:28:10 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.


Return to posts index


Lamar DaughmaRe: Depth ripple with action script (following Null object)
by on Aug 30, 2015 at 9:55:35 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


Return to posts index

Kalle KannistoRe: Depth ripple with action script (following Null object)
by on Aug 31, 2015 at 10:38:22 am

Did you get it to work on Z?


Return to posts index


Kalle KannistoRe: Depth ripple with action script (following Null object)
by on Aug 30, 2015 at 12:38:20 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.


Return to posts index


Wallis ParnellRe: Depth ripple with action script (following Null object)
by on Sep 1, 2015 at 1:20:42 pm

See what you are doing, do you have posted, the example, and a pic do all the code. Love to build, and learn this.
Yepper, Im a beginner, but enthusiast in motion.
Thanks.


Return to posts index

Kalle KannistoRe: Depth ripple with action script (following Null object)
by on Sep 1, 2015 at 2:17:53 pm

I made a simplified sample file:

9208_delayedripple.aep.zip


Return to posts index

Lamar DaughmaRe: Depth ripple with action script (following Null object)
by on Sep 1, 2015 at 4:11:32 pm

your a legend man thanks, works a charm


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]