Page 1 of 1

Expressing layer startTime

Posted: September 4th, 2007, 12:04 am
by blies
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

Re: Expressing layer startTime

Posted: September 5th, 2007, 10:26 pm
by Mylenium
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

Posted: September 6th, 2007, 1:38 am
by blies
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 ?

Posted: September 6th, 2007, 4:28 am
by Paul Tuersley
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);

Posted: September 6th, 2007, 5:02 am
by blies
Many thanks Paul.
Now it's more clear ;)