# Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions InPoint OutPoint based expression

• # InPoint OutPoint based expression

• Hello am trying to figure out how to control position and transparency based on the layer’s in and out point. Any pointers would be greatly appreciated!

Thanks

• That’s a little vague, but maybe this example will help. This is an auto fade-in/fade-out based on in and out points:

if (time < (inPoint+outPoint)/2)
else

Dan

What I need is very simple but I can’t seem to figure it out. Basically I want a layer to translate on X in lets say 20 units (ease in) and then translate out (ease out) -20 units. But I want that translate operation to be controlled by the length of the layer so no matter how long the layer is it will always translate the 20 units. Basically I want to learn how to make the in and out points drive Position/Rotation

Thank you!

• You could modify the fade in/out expression to something like this for position:

moveDur = .5;
moveDist = [20,0];
if (time < (inPoint+outPoint)/2)
ease(time,inPoint,inPoint+moveDur,value,value+moveDist)
else
ease(time,outPoint-moveDur,outPoint,value+moveDist,value)

Dan

• This is what I came up with:

`// Fire and Ice present: Accutimer Xposition automator v01`

`xStart = -44.7; xLand = 324.2; xEnd = -44.7;`

`t = .2 //Amount of time for animation landIn = inPoint+t; landOut = outPoint-t;`

`x = easeOut(time, inPoint, landIn, xStart, xLand); if (time >= landOut){ x = easeIn(time, landOut, outPoint, xLand, xEnd); }`

`[x];`

In the expression below, how do I stipulate t with specific number of frames rather than the .2 value

`xStart = -44.7; xLand = 324.2; xEnd = -44.7;`

`t = .2 //Amount of time for animation landIn = inPoint+t; landOut = outPoint-t;`

`x = easeOut(time, inPoint, landIn, xStart, xLand); if (time >= landOut){ x = easeIn(time, landOut, outPoint, xLand, xEnd); }`

`[x];`

• something like this:

f = 6; // number of frames
t = framesToTime(f);

Dan

• that’s perfect, thank you!

Here is the final code:

`// Fire and Ice present: Accutimer Xposition automator v01`

`yStart = 940; yLand = 864; yEnd = 940;`

`f = 6; // number of frames t = framesToTime(f);`

`landIn = inPoint+t; landOut = outPoint-t;`

`y = easeOut(time, inPoint, landIn, yStart, yLand); if (time >= landOut){ y = easeIn(time, landOut, outPoint, yLand, yEnd); }`

`[y];`

• ### Dmitry Gavriliuk

February 28, 2014 at 12:47 am

Hello Dan.
This is what I’m looking for!
But how can I do a position movement more smoothly? Now it’s not so EasyIn and EasyOut. Need more influence.
Thanks.

`xStart = 3200; xLand = 960; xEnd = - 1400;`

`f = 10; t = framesToTime(f); landIn = inPoint+t; landOut = outPoint-t;`

`x = easeOut(time, inPoint, landIn, xStart, xLand); if (time >= landOut){ x = easeIn(time, landOut, outPoint, xLand, xEnd); } y = value;`

`[x, y];`

• ### Torben Christensen

March 20, 2015 at 11:53 am

[Dan Ebberts] “You could modify the fade in/out expression to something like this for position:

moveDur = .5;
moveDist = [20,0];
if (time < (inPoint+outPoint)/2)
ease(time,inPoint,inPoint+moveDur,value,value+moveDist)
else
ease(time,outPoint-moveDur,outPoint,value+moveDist,value)

Dan”

What if I want to control which axis it moves on? In my case, I want it to move on Y-axis instead of X-axis. Thanks.

Viewing 1 - 10 of 10 posts