ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Change the width only in the horizontal direction by slider

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Arti Krakow
Change the width only in the horizontal direction by slider
on Jan 15, 2018 at 7:24:20 pm
Last Edited By Arti Krakow on Jan 16, 2018 at 7:24:02 am

Hello guys,

could you help me please with one expression which i can't figure out?
I have an animated bar with text in another layer and I would like to change the width of the bar only in the horizontal direction by slider and only between keyframes 3 and 4 (the static part of the animation). For now, the first part of expression works great, but the second part doesn`t, width remains the same until the end of the animation. I'm a newbie in Java, so can you someone help me?

Thank you in advance

Arti

if (numKeys >=6 ) {
t1 = key(2).time;
t2 = key(3).time;
slider = thisComp.layer("Controls").effect("Scale width")("Slider");
v1 = [value[0], value[1]];
v2 = [slider, value[1]];
easeOut(time, t1, t2, v1, v2);
} else if (numKeys >=6){
t4 = key(4).time;
t5 = key(5).time;
slider = thisComp.layer("Controls").effect("Scale width")("Slider");
easeIn(time, t4, t5, v1, v2)
}


Return to posts index

Matt Volp
Re: Change the width only in the horizontal direction by slider
on Jan 23, 2018 at 4:02:41 am
Last Edited By Matt Volp on Jan 23, 2018 at 4:16:24 am

Try this (untested):

slider = thisComp.layer("Controls").effect("Scale width")("Slider");
t1 = key(2).time;
t2 = key(3).time;
t4 = key(4).time;
t5 = key(5).time;
v1 = [value[0], value[1]];
v2 = [slider, value[1]];

if (numKeys >=6 )
easeOut(time, t1, t2, v1, v2);
else
easeIn(time, t4, t5, v1, v2)


Matt


Return to posts index

Arti Krakow
Re: Change the width only in the horizontal direction by slider
on Jan 23, 2018 at 4:05:07 pm
Last Edited By Arti Krakow on Jan 23, 2018 at 4:09:31 pm

Hello, thank you for your help, but your expression isn`t work. But today I finally figured out this problem. This script is works great for me.

Thanks

AK

slider = thisComp.layer("Controls").effect("Scale width")("Slider");
t1 = key(2).time;
t2 = key(3).time;
t4 = key(4).time;
t5 = key(5).time;
v1 = [value[0], value[1]];
v2 = [slider, value[1]];
v3 = [slider, value[1]];
v4 = [value[1], value[1]];
if (time < key(4).time) {
easeOut(time, t1, t2, v1, v2);
} else if (time < key(5).time) {
easeIn(time, t4, t5, v3, v4)
} else
[key(6).time, value[1]];


Return to posts index

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