Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by David Gray on April 16, 2009 at 1:01 pm

    Hey 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 G

    David Gray replied 17 years, 4 months ago 3 Members · 10 Replies
  • 10 Replies
  • Dan Ebberts

    April 16, 2009 at 1:16 pm

    Would a 3-frame delay work?

    delay = 3;
    thisComp.layer(“Text1”).opacity.valueAtTime(time – framesToTime(delay))

    Dan

  • David Gray

    April 16, 2009 at 1:40 pm

    Hey 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: opacity

    So I guess I’m missing an ) from somewhere not sure where though.

    Cheers
    Dave

  • Dan Ebberts

    April 16, 2009 at 1:55 pm

    Just 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 pm

    Oops 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 pm

    Actually 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 pm

    This should work:

    delay = 3;
    opat = thisComp.layer(“Text1”).opacity.valueAtTime(time – framesToTime(delay));
    if (opat < 100) 0 else 100 Dan

  • David Gray

    April 16, 2009 at 9:46 pm

    Cheers Dan!

    You’ve been a great help.

  • David Gray

    April 17, 2009 at 1:20 pm

    Hey 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 pm

    To look at the layer below you can use:

    delay = 3;
    layerBelow = thisLayer.index+1;
    thisComp.layer( layerBelow).opacity.valueAtTime(time - framesToTime(delay))

    Cheers,
    Ben

    Curious Turtle Professional Video
    Training | Editing |Support

    http://www.curiousturtle.com
    Just out: Rock Steady : Successful Motion Tracking in Mocha & After Effects

  • David Gray

    April 19, 2009 at 1:14 am

    Thanks a lot mate! Working perfectly.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy