Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Opacity Driven Expression

  • Opacity Driven Expression

    Posted by Barry Suydam on March 16, 2011 at 4:36 pm

    I have 19 numerical layers stacked(1-19) one on top of the other. I key-framed a line/bar to scroll from top (1) to Bottom (19). What I am looking for is a way to have them appear on screen as the bar passes over them(go from 0 opacity to 100) Any help would be much appreciated.

    I intend on doing the same with the 19 corresponding text layers(chapter titles)but this is a good start?

    Dan Ebberts replied 15 years, 2 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    March 16, 2011 at 6:05 pm

    I’m guessing this may not really be what you want, but this is a simple stab at it. Each layer should pop on as the center of layer “Bar” passes (vertically) its own center.

    L = thisComp.layer(“Bar”);
    p = L.toWorld(L.anchorPoint);
    p[1] > toWorld(anchorPoint)[1] ? 100 : 0;

    Dan

  • Barry Suydam

    March 16, 2011 at 7:08 pm

    It is an honor to be educated by Mr. Ebberts himself. It worked as it should. Thank you so much. Is there a simple way to ease in the opacity. If so that would be over the top assistance? Thanks again Dan.

  • Dan Ebberts

    March 16, 2011 at 7:38 pm

    This version should ease in the opacity as the bar moves from the layer’s upper edge to its center:

    L = thisComp.layer(“Bar”);
    p = L.toWorld(L.anchorPoint);
    easeIn(p[1],toWorld([0,0])[1],toWorld(anchorPoint)[1],0,100)

    Dan

  • Barry Suydam

    March 18, 2011 at 1:35 pm

    Great, thanks…

    I found this expression on your website////

    point1=this_layer.position;
    point2=thisComp.layer(“Text Bar”).transform.scale;

    delta=sub(point1, point2);

    distance=length(delta);
    linear(distance, 0,50, [150,150],[100,100]);

    What I am trying to accomplish is as that bar moves past the text layer it moves the layer position 50 pixels on the x axis only and once it passes completely it returns to its original value. So what I came up with is the following however it don’t work. Any help would be appreciated.

    point1=this_layer.position;
    point2=thisComp.layer(“Text Bar”).transform.position;
    x = value =50
    delta=sub(point1, point2);
    distance=length(delta);
    ease(distance, 0,50, [x,[1]],[[0],[1]]);

  • Dan Ebberts

    March 18, 2011 at 6:25 pm

    This probably gets you closer:

    p1=transform.position;
    p2=thisComp.layer(“Text Bar”).transform.position;
    distance=length(p1,p2);
    ease(distance,0,50,value+[50,0],value)

    Dan

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