Activity › Forums › Adobe After Effects Expressions › If and Wait
-
If and Wait
Posted by David Gray on April 16, 2009 at 1:01 pmHey Guys,
I’m new to expressions so don’t really know what i’m doing wrong or right. :p
Basically I’m trying to get a layers opacity to go to 100 3 frames after another layers opacity has reached 100.
Is there even a wait command?
Text1 is the layer than i want to trigger ther
opacity change in text2 in this example.I’m thinking it would be something along the lines of:
if (thisComp.layer(“Text1”)opacity) =100) {wait = 3 then opacity =100}
else
{opacity = 100}
Any and all help greatly appreciated.
Cheers
Dave GDavid Gray replied 17 years, 4 months ago 3 Members · 10 Replies -
10 Replies
-
Dan Ebberts
April 16, 2009 at 1:16 pmWould a 3-frame delay work?
delay = 3;
thisComp.layer(“Text1”).opacity.valueAtTime(time – framesToTime(delay))Dan
-
David Gray
April 16, 2009 at 1:40 pmHey Dan,
Thanks for the help I think it should. I’m having some problems though probably just due to my lack of knowledge.
At the moment the expression is(in texts 2 opacity):
delay = 3;
if (thisComp.layer(“Text1”)opacity.valueAtTIME)(time – framesToTime(delay) then {100} else {0};I’m getting the following error don’t think it is even getting to the delay.
After Effects warning :Expected: )
Expression disabled.
Error occured at line 2.
Comp: Comp 1
Layer: 1 (‘text 2’)
property: opacitySo I guess I’m missing an ) from somewhere not sure where though.
Cheers
Dave -
Dan Ebberts
April 16, 2009 at 1:55 pmJust copy and paste this exactly (don’t add the else stuff):
delay = 3;
thisComp.layer(“Text1”).opacity.valueAtTime(time – framesToTime(delay))Dan
-
David Gray
April 16, 2009 at 2:07 pmOops yep is working now!
Only Problem now (not a major one) is it fades in. Would there perhaps be a way for it to place another key frame on the second frame with opacity 0 and then jump up to 100?
Thanks a lot so far though!
Cheers
Dave -
David Gray
April 16, 2009 at 2:09 pmActually don’t worry it happens so fast you can’t really tell :p
Though if there is a solution you can think of is always interesting to hear/learn
Cheers
Dave -
Dan Ebberts
April 16, 2009 at 2:26 pmThis should work:
delay = 3;
opat = thisComp.layer(“Text1”).opacity.valueAtTime(time – framesToTime(delay));
if (opat < 100) 0 else 100 Dan -
David Gray
April 17, 2009 at 1:20 pmHey Dan,
Back again for your excellent help :p
I’m thinking that it would be possible to optimise this expression for my task my having it insert the name of the layer below automaticly. I had a quick google but no avail.
So the code in layman’s terms
delay = 3;
thisComp.layer(“LAYERBELOW”).opacity.valueAtTime(time – framesToTime(delay)) -
Curious Turtle
April 17, 2009 at 2:03 pmTo look at the layer below you can use:
delay = 3;
layerBelow = thisLayer.index+1;
thisComp.layer( layerBelow).opacity.valueAtTime(time - framesToTime(delay))Cheers,
BenCurious Turtle Professional Video
Training | Editing |Supporthttp://www.curiousturtle.com
Just out: Rock Steady : Successful Motion Tracking in Mocha & After Effects
Reply to this Discussion! Login or Sign Up