Skip to main content
Inspiring
October 3, 2014
Question

Set inPoint with expression?

  • October 3, 2014
  • 4 replies
  • 1036 views

Hi,

Is there some way to set the in and out points of a layer in an expression?

thisLayer.inPoint seems to be read-only...

Thanks,

S

This topic has been closed for replies.

4 replies

Legend
January 23, 2024

Or using 2 markers:

m1 = marker.key(1).time;
m2 = marker.key(2).time;

time >= m1 && time <= m2 ? 100 : 0

 

 

Community Expert
January 23, 2024

Expressions cannot control any property that does not have a stopwatch to set a keyframe.

 

You can use time and a simple if statement to animate opacity. If you want a layer to become visible at 60 frames into the timeline, you can use something like this:

 

t = time;
st = framesToTime(60);
if (t < st)
	0;
else
	100;

 

I use layer in and out points all the time to automate animations. This expression will do a 15-frame fade starting at the in point of a layer and then start a 60-frame fade out just before the layer ends. 

 

t = time - inPoint;
dur = outPoint - inPoint;
frmsIn = framesToTime(15);
frmsOut = framesToTime(60);

fadeIn = linear(t, 0, frmsIn, 0, 100);
fadeOut = linear(t, dur - frmsOut, dur, 0, -100);
fadeIn + fadeOut;

 

Maybe those ideas will give you some ideas of how to automate things and save time.

Known Participant
January 23, 2024

You may try to timeremap the layer and then implement a keyframe delay which you could control then via expression?

Dan Ebberts
Community Expert
Community Expert
October 3, 2014

No, expressions can't change anything except the value of the property hosting the expression. Depending on what you're trying to do, you might be able to do it with time remapping and/or opacity expressions.

Scripting has access to in and out points (not sure if that helps).

Dan