ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

React layer properties with the inPoint and/or outPoint of another layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jonatan Nogueira
React layer properties with the inPoint and/or outPoint of another layer
on Sep 18, 2018 at 10:30:21 pm

Hello everyone! I'm new here, and in expression/scripting after effects stuffs.
A little ago, I just learned how to fadein and fadeout expression for opacity, and then, i have used it a lot of times in others kind of properties (like audio volume, opacity, position, etc). the expression I usually use is that bellow:


fade = 1;
fadein = (time - inPoint)/fade;
fadeout = (outPoint - time)/fade;
if(time < inPoint + fade)(linear(fadein,0,1)*value)
else if(time > outPoint - fade)(linear(fadeout,0,1)*value)
else(value
)


And it fits great for me, when I need a simple auto fade in that case.
But, when I try to link this to another in/outpoint's layer, the outPoint doesn't work that good. The expression I try is the bellow one example:


fade = 1;
x = thisComp.layer("whatever1");
y = thisComp.layer("whatever2");
fadein = (time - x.inPoint)/fade;
fadeout = (y.outPoint - time)/fade;
if(time < x.inPoint + fade)(linear(fadein,0,1)*value)
else if(time > y.outPoint - fade)(linear(fadeout,0,1)*value)
else (value)


Someone could help me with that?
And please, if it's in a wrong place or I place the code wrong, give me some advice .

"I never quit trying. I never felt that i didn't have a chance to win!"


Return to posts index

James Ronan
Re: React layer properties with the inPoint and/or outPoint of another layer
on Sep 20, 2018 at 11:31:48 am

Your expression works for me, but it fades in based on "whatever1" inPoint, and fades out on another layer "whatever2" outPoint... Is that what you want?

If you want you to fade in and out based only one other layers layers in and outPoints (e.g. "whatever1") try this:


fade = 1;
x = thisComp.layer("whatever1");
fadein = (time - x.inPoint)/fade;
fadeout = (x.outPoint - time)/fade;
if(time < x.inPoint + fade)(linear(fadein,0,1)*value)
else if(time > x.outPoint - fade)(linear(fadeout,0,1)*value)
else (value)


Hope that helps.


Return to posts index

Jonatan Nogueira
Re: React layer properties with the inPoint and/or outPoint of another layer
on Sep 20, 2018 at 1:52:47 pm

Thanks for your help, but it's not that yet...
I mean:

There's 3 layers to make the effect i'm intending:
A = The layer that will take the effects based on the in/out points of others layers;
B = The layer will give to A the inPoint;
C = The layer will give to A the outPoint.

In the pic below, there's what I want.



I want to create a template for stories. Each month will have a new one. The layers are the chapters, but the water mark, the intro and the ending are always the same.
So, I want to figure it out how to do it automatically to get it faster.

"I never quit trying. I never felt that i didn't have a chance to win!"


Return to posts index


James Ronan
Re: React layer properties with the inPoint and/or outPoint of another layer
on Sep 20, 2018 at 2:55:59 pm

Ah I understand. Your original expression is working for me when used on the opacity property of layer A.

Are you getting an error?


Return to posts index

Jonatan Nogueira
Re: React layer properties with the inPoint and/or outPoint of another layer
on Sep 20, 2018 at 3:11:11 pm

Yeah, not always, but yeah, the error happen!
Sometimes I need to write a lot of times to get it working. Mainly when used with audio properties (audio levels).
The inPoint (start) works great, but when try outPoint, it give some error, doesn't work right or stuff.
With audio, it doesn't work properly, maki the audio become crazy haha or not work as i though it would.

"I never quit trying. I never felt that i didn't have a chance to win!"


Return to posts index

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