Expressing layer startTime

Moderators: Disciple, zlovatt

Post Reply
blies
Posts: 14
Joined: May 8th, 2007, 8:19 am

Hi.
How can I create an expression on layer startTime ?
I have one layer with some keyframes in the opacity transformation; I dup this and I would to change with an expression his startTime.
Is it possible ?

Thanks
Image
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

blies wrote:Hi.
How can I create an expression on layer startTime ?
I have one layer with some keyframes in the opacity transformation; I dup this and I would to change with an expression his startTime.
Is it possible ?

Thanks
That's what .valueAtTime() is for. Apply it to whatever property you like and add an offset e.g. based on the layer index.

Mylenium
[Pour Mylène, ange sur terre]
blies
Posts: 14
Joined: May 8th, 2007, 8:19 am

Thanks Mylenium, but maybe I wrong my explanation.
What I want to achieve is something like this:

Code: Select all

|----------|
   |----------|
      |----------|
But alla layers are

Code: Select all

|----------|
|----------|
|----------|
Is it possible ?
Image
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Expressions aren't able to actually change the start time for a layer. They can only affect the property on which they're applied, and there is no "start time" property. To do the equivalent of sliding the layers in the Timeline, you'd need a script.

But you can use the valueAtTime() expression to offset the values on any given property. For example, applied to an opacity property, this expression would offset any keyframed opacity values, based on the layer's index number.
opacity.valueAtTime(time - index);

Or you could use the pick whip to link to keyframes on another layer:
thisComp.layer("Control Layer").transform.opacity.valueAtTime(time - index);

If you enable time remapping on a layer, you can use the expression to offset the layer's source footage:
timeRemap.valueAtTime(time + index);
blies
Posts: 14
Joined: May 8th, 2007, 8:19 am

Many thanks Paul.
Now it's more clear ;)
Image
Post Reply