Turn positive keyframes in alternating positive&negative...

Scripting for After Effects

Turn positive keyframes in alternating positive&negative...

Postby mika1977 on 11/7/2017, 2:45 pm

Hi guys,

I created keyframes with soundkeys and I want to apply them to one of the distort features in E3D. I connect the two with the pick whip tool.
in Soundkeys I can create custom keyframes for the bass frequency, let's say from 0 to 40.
I apply it to a distort value inside E3D and I get something like:
0 - 40... 0 - 40... 0 - 40... 0 - 40... 0 - 40... in the rythm of the beat, great.

can I add an extra expression where I can change the generated keframes into
0 - 40... 0 - minus40... 0 - 40... 0 - minus40...

with only the positive values I can only animate to "the right side" of the model...

is there a way to alternate the values? first pass: the keyframes are positive with the second they are negative and so on...
so I can animate first 0 - 40 (positive) to the right side
then 0 - minus40 (negative) to the left
positive
negative
and so on...

is there a way to get this done with an expression?

Thanks for helping out,
mika
mika1977
 
Posts: 9
Joined: 08/5/2015, 3:33 pm
System Specs: windows 7. i7 960. 64bit

Re: Turn positive keyframes in alternating positive&negative...

Postby prathamesh on 12/8/2017, 4:49 am

duplicate soundkeys layer remove its keyframes and pick whip it to previous soundkeys layer. and type at the end of the expression *-1

so your first layer will have 0 - 40... 0 - 40... 0 - 40... 0 - 40... 0 - 40
and second layer will have 0 - -40... 0 - -40... 0 - -40... 0 - -40... 0 - -40

as anything multiplied by 0 will always be 0 so 40 will change to -40


hope this helps!
prathamesh
 
Posts: 21
Joined: 07/24/2017, 9:36 pm
System Specs: i3-2330m 4gb ram 1gb gpu amd radeon hd 7400m


Return to After Effects Expressions