Page 1 of 1

Applying an expression just at exact layer time

Posted: September 8th, 2008, 5:17 am
by ccf
Hi:

How can I get control to any expression, in order to apply it in a layer or a group of layers, just in the time I decide, so I can switch on or off at taste, or maybe play with the expression parameters at different times.

Thanks

Re: Applying an expression just at exact layer time

Posted: September 8th, 2008, 5:34 am
by Atomic
Here is how to set the source text of a text layer based upon the frame #.

Code: Select all

thisFrame=timeToFrames(t=time+thisComp.displayStartTime,fps=1.0/thisComp.frameDuration,isDuration=false);
if (thisFrame==0){text.sourceText = 'Hello World';}
If you want to apply something to a group of layers you may be able to apply the expression to an adjustment layer. Depends on what you want to do.

Re: Applying an expression just at exact layer time

Posted: September 10th, 2008, 12:04 pm
by ccf
Atomic:

I´m a beginneer in expressions, I dont understand how to do this.

What I need is to able or disable an expression applied to any layer, in order just to have the expression only in the moment I decide.

Thanks for your support

CCF

Re: Applying an expression just at exact layer time

Posted: September 15th, 2008, 3:58 pm
by Disciple
The easiest way to do this would be to use the Expression Controls (check the effects menu).
Depending on the type of data you expression is creating, or reading, you can easily controls its effects via keyframes.

Alex

Re: Applying an expression just at exact layer time

Posted: September 16th, 2008, 12:06 pm
by Atomic
All you ave to do is add an else to the if statement.

Code: Select all

thisFrame=timeToFrames(t=time+thisComp.displayStartTime,fps=1.0/thisComp.frameDuration,isDuration=false);
if (thisFrame==10)
{
text.sourceText = 'This is frame #10 text.';
}
else
{
text.sourceText = "This is the default text."
}