-
Is a layer’s startTime set in stone upon creation?
I got a question from my colleague that does some scripting in After effects on templates that I’ve made regarding startTime that I got stumped by.
I’ve tried googling but apparently my google-fu isn’t good enough.My question is this: Is the startTime of a layer set just once – when the layer is created – and never updated after that? How does startTime even work?
I’ve tried to illustrate what i mean.
Here I have created a solid that is two seconds long. Above that I have a text layer with the expression seen in the timeline. The solid has a startTime of 0.

When I drag the layer to the right the startTime updates accordingly. Seems to work as expected.

But if I shorten the layer by dragging the left side to the right, the startTime stays the same?

And if I move the layer to the beginning of the composition the startTime updates again to a completely different time.

What exactly is deciding the startTime of a layer? It seems like it has saved the original startTime from when the layer was created, and just locked that in place. We initially had this issue with an imported video file, but it also works on solids, that’s why I used that in my example. Is it possible to somehow extract the original startTime on a layer, even if the layer has been moved and/or trimmed? Is there some way to “clear” the startTime or force an update? How does this even work?
/C