ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

I need an expression but i don't know which one to use

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Oliver Torres
I need an expression but i don't know which one to use
on Jul 2, 2020 at 3:44:40 pm

Hi, im doing a kind of rubiks cube inside after effects. Its a 3D cube that scales to the beat of a track. the thing, im trying to make some cubes offset from the original position they are, and then come back to it as the beat lowers. si it kinda offsets as the beat rises and goes back to original position as the beat lowers. I've been craking my head combining various expressions but it doesnt give me what i want. Please help, I really lost here



the aforementioned cube


Return to posts index

Filip Vandueren
Re: I need an expression but i don't know which one to use
on Jul 2, 2020 at 7:24:42 pm

Without delving into specifics, because thetre could be a lot of Null-layers in this construction or just one, we don't know. But sometimes it helps remembering that you can also alter the position of a layer by animating its anchorPoint, instead of its position. Makes things easier sometimes ?



Return to posts index

Oliver Torres
Re: I need an expression but i don't know which one to use
on Jul 2, 2020 at 11:25:52 pm

I thought that too, but the thing is that i don't know which expression to use in this case. all the little cubes are attached to a null object that itself is attached to the effect, what in an individual level would do is few of the cubes would offset on their anchor point BUT to the beat. in that case, what can i do?


Return to posts index


Filip Vandueren
Re: I need an expression but i don't know which one to use
on Jul 3, 2020 at 12:15:28 pm

Do you already have keyframe data about the beat of your music?
From audio to keyframes, or trapcode soundkeys ?

With a Few cubes, do you mean you want different cubes to react at different random beats?



Return to posts index

Oliver Torres
Re: I need an expression but i don't know which one to use
on Jul 3, 2020 at 1:46:43 pm

Yes i do, i used sound keys.

No, what i mean is that all the cubes react to the same beat, but some react a bit more, like they offset a bit more from their position and from the others and then come back to their original position on the cube, when the beat lowers.


Return to posts index

Filip Vandueren
Re: I need an expression but i don't know which one to use
on Jul 3, 2020 at 2:09:35 pm

OK, you need a random-amount mulitplier, but the random-amount has to be unique for the layer, and not change every frame.
seedRandom() with the second parametert set to true can achieve this.

example:

direction_to_move = [0,0,1];
seedRandom(index,true);
randomAmount = random(1,15);
soundKeysAmount = thisComp.layer("Audio").effect("Sound Keys")("Output 1");

value + direction_to_move * randomAmount * soundKeysAmount;




Return to posts index


Oliver Torres
Re: I need an expression but i don't know which one to use
on Jul 3, 2020 at 4:58:59 pm

I'll try it, thanks


Return to posts index

Oliver Torres
Re: I need an expression but i don't know which one to use
on Jul 3, 2020 at 7:09:34 pm

it didnt work. where whould i put it, on z position or anchor point?


Return to posts index

Filip Vandueren
Re: I need an expression but i don't know which one to use
on Jul 3, 2020 at 7:56:47 pm

Oh, so you split position into separate x,y,z ?
Then the first line can be omitted, as well as a tweak to the last line:

seedRandom(index,true);
randomAmount = random(1,15);
soundKeysAmount = thisComp.layer("Audio").effect("Sound Keys")("Output 1");

value + randomAmount * soundKeysAmount;

If that doesn’t work, then I’m having trouble to understand how your composition is built.



Return to posts index


Oliver Torres
Re: I need an expression but i don't know which one to use
on Jul 3, 2020 at 9:21:59 pm

It's just the thing i wanted. Thank you so much man


Return to posts index

Oliver Torres
Re: I need an expression but i don't know which one to use
on Jul 4, 2020 at 3:09:14 pm

Hey man, do you think you could teach me on how you got to that code, please? I only had a superficial introduction to expression, and I would like to learn some more. I would really appreciate to Lear as much as I can of AE and do motion better


Return to posts index

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