Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Home
- >
- After Effects
- >
- 2 expressions in the one property

Highlighted
##

2 expressions in the one property

New Here
,

Oct 14, 2020

Copy link to clipboard

Copied

Hi. Simple animation with scale, 2 keyframes:

1st - 0%, 0%

2nd - 100%, 100%

I want to add bounce effect and control the keyframe values via point control. But for some reason the point control doesn't work.

Expressions I used:

if (numKeys > 1){

t1 = key(1).time;

t2 = key(2).time;

v1=effect("Scale IN")("Point");

v2=effect("Scale OUT")("Point");

linear(time, t1, t2, v1, v2);

}else value

amp = .06;// The higher the value, the greater the amplitude

freq = 2;// The higher the value, the higher the frequency

decay = 5;// The higher the value, the smaller the delay

n = 0;

if (numKeys > 0){

n = nearestKey(time).index;

if (key(n).time > time){

n--;

}

}

if (n == 0){

t = 0;

}else{

t = time - key(n).time;

}

if (n > 0){

v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}else{

value;

}

TOPICS

Error or problem,
Expressions,
FAQ

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

2 expressions in the one property

New Here
,

Oct 14, 2020

Copy link to clipboard

Copied

Hi. Simple animation with scale, 2 keyframes:

1st - 0%, 0%

2nd - 100%, 100%

I want to add bounce effect and control the keyframe values via point control. But for some reason the point control doesn't work.

Expressions I used:

if (numKeys > 1){

t1 = key(1).time;

t2 = key(2).time;

v1=effect("Scale IN")("Point");

v2=effect("Scale OUT")("Point");

linear(time, t1, t2, v1, v2);

}else value

amp = .06;// The higher the value, the greater the amplitude

freq = 2;// The higher the value, the higher the frequency

decay = 5;// The higher the value, the smaller the delay

n = 0;

if (numKeys > 0){

n = nearestKey(time).index;

if (key(n).time > time){

n--;

}

}

if (n == 0){

t = 0;

}else{

t = time - key(n).time;

}

if (n > 0){

v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}else{

value;

}

TOPICS

Error or problem,
Expressions,
FAQ

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

alisunh

Oct 14, 2020
0
/t5/after-effects/2-expressions-in-the-one-property/td-p/11506793
2
Replies
2

Most Valuable Participant
,

Oct 14, 2020

Copy link to clipboard

Copied

You need to replace the "value" bits in the second expression with the results of your linear() function from the first expression. Define a custom variable and substitute it. You might want to actually read the help on expressions to get an understanding how they work, not just copy & paste code bits from the Internet...

Mylenium

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Reply

Loading...

Mylenium

Oct 14, 2020
0
/t5/after-effects/2-expressions-in-the-one-property/m-p/11507363#M152288
alisunh
LATEST

New Here
,

Oct 14, 2020

Copy link to clipboard

Copied

Thanks a lot! I've changed the 2nd expression and it works. Awesome!

if (numKeys > 1){ t1 = key(1).time; t2 = key(2).time; v1=thisComp.layer("Text").effect("Point Control")("Point"); v2=thisComp.layer("Text").effect("Point Control 2")("Point") linear(time, t1, t2, v1, v2); }else value amp = .06; freq = 2; decay = 5; val = linear(time, t1, t2, v1, v2); n = 0; if (numKeys > 0){ n = nearestKey(time).index; if (key(n).time > time){ n--; } } if (n == 0){ t = 0; }else{ t = time - key(n).time; } if (n > 0){ v = velocityAtTime(key(n).time - thisComp.frameDuration/10); val + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t); }else{ val; }

Community Guidelines

Reply

Loading...

alisunh

Oct 14, 2020
0
/t5/after-effects/2-expressions-in-the-one-property/m-p/11507528#M152292
Resources

Troubleshooting FAQs

After Effects Community Recap

Getting started with After Effects

Using the Community
Experience League
Terms of Use
Privacy Policy
Cookie preferences
AdChoices
Language:

- Deutsch
- English
- Español
- Français
- 日本語コミュニティ
- Português

Copyright © 2020 Adobe. All rights reserved.